LV memory leak - how to use windows API SetProcessWorkingSetSize (from Kernel32.dll)

Hi comrade LV'ers

Well - it's a little tricky, but I will try and explain the problem and then ask the solution, because it is maybe someone knows a better way to deal with this... can get a bit long, sorry - if a solution comes up it will allow all of us to do more effective memory LV code so please read on...

Here's the deal:

When building even a simple executable LV, looking at the windows task manager will give a fairly large amount of memory allocated for such a small program - and the only way to free that is physically clicking windows minimize button, and then suddenly the amount falls to only a few MB and to maximize the window again once memory increase consumption somewhat new , but for a simple construction of VI for an exe that movement can alter consumption of + 70 MB less than 15 MB... This is regardless of the code that you put in the VI, so no coding example in this post, as is works the LV - you can even test with the development environment - look at the task mgr and verify the consumption of memory of LabVIEW, open inappropriate, ALL AND windows incl. Explorer etc., and you will see a significant decrease in the use of memory even after optimizing yet... This has bugged me since the first day, but as the RAM is a near zero cost these days is not something that I stay awake at night thinking... However - I spent in the tools to "publish to the web", eager to be a part of monitoring remote for my application my clients to discover the increased ease of use of the software that I sell them...

All right, the editing is really easy (I use the monitoring function, NOT the embeded, clients should not have installed Labview RunTimeEngine because they could be watching a platform RTE unsupported as a web browser for mobile phone)

Everything works very well also for the purposes of construction. -J' noticed that once users start remotely monitor running application - use memory in the application being LV begins to rise - and it keeps this making - to such an extent that you can drain the full computer and run the cliff with a windows error... It is of course not very productive for me, being specialized in measurement applications that usually runs for a long period of time - I first thought that I had made a few poor emissions in the VI will display on the Web page - but it turns out that I can reproduce this behavior with a simple Boolean on an empty façade...

Supported OR has been informed, and they admit there is a problem, but so far, solutions to them was a bit too exotic for my taste, and so I'm looking for help from colleagues LV programmers...

See you-the method to solve the memory consumption, is exactly the same one mentioned above... minimize the application running with the "minimize" button and all the memory will be released, as soon as you maximize the application and users are viewing from a distance, the use of memory raises once again, and history repeats... As mentioned previously, reducing the window via normal calls from LV property nodes does not give the same result, no more than a request deallocation of a VI (when you profile a project, there is no VI not growing to in memory, it is the LV the treat yourself do)

After many search on Google for many hours, I came across this:

http://support.Microsoft.com/?kbid=293215

I think cutting the process with SetProcessWorkingSetSize would solve this problem, and now I would really like to be able to do that in my program, so that users are not forced to reduce every X hour program depending on their size of system...

However - I have absolutely NO experience in calling the APIs windows of LV, I need someone with this knowledge to give an example of how to call this... I looked at the examples on how to make calls to the windows API - there is an example in this forum with a few inside llb and I gained an understanding about how parameters are passed between calls, but none to those who understand the 'hProcess' handle which is apparently necessary for this specific work winAPI call - everyone in this forum with the knowledge on how to get the handle of a VI, if possible, and could provide an example VI for me to use - or better yet, someone with knowledge of the procedure to follow in LV it self?

Your help is highly appreciated

Best regards

Jacob

LV8.6.1 patch something

Win XP

Hello

see http://decibel.ni.com/content/docs/DOC-9292

It is a kind of task manager with the ability to carve out the memory of a process.

He calls SetProcessWorkingSetSize.

Maybe it's help you wil

Cosmin

www.controlsag.ro

Tags: NI Software

Similar Questions

  • How to use windows search to search the contents of a bunch of files with random names / extensions?

    How to use windows search to search the contents of a bunch of files with random names / extensions? Plain txt files say 1,000 with random name of file extensions?

    You can always search within those, but you need to add extensions to the file system so that it knows to look inside these files.  You said that you have a lot, so it's perhaps tedious.  Here's How to search within several types of files.

    One thing you could try is rather to make a copy of this file, rename all the files to the same extension (even an extension false for example something.bill) and perform your search on this band.  Just an idea.

  • How to use windows update with browser firefox4

    How to use windows update with browser firefox4

    You MUST use Internet Explorer to access http://windowsupdate.microsoft.com.

  • How to use Windows Easy Transfer

    When you use transfer should I the two computers connected to a screen, mouse, keyboard... etc?

    http://support.Microsoft.com/kb/928634

    How to use Windows Easy Transfer to migrate files and settings from one Windows computer to another Windows Vista-based computer

    Read the above info.

    See you soon.

    Mick Murphy - Microsoft partner

  • How to use windows scan with the new canon printer is connected and the copy and printing, but can't seem to be able to use the technique of scan windows

    How to use windows scan with my new canon MX 922 printer.  It is conncected and copying and printing but can't seem to use the windows scan option, the cannon that which for me is slow thanks

    All in one, type printers (print, copy, scan) usually have a very specific set of instructions during the installation.  If not followed exactly the probability is that the scanner will not work.

    Canon: http://www.usa.canon.com/cusa/consumer

    Download and read the Setup instructions for your model, have you followed the instructions exactly, more precisely when to connect the printer / scanner during installation of the software process?

    J W Stuart: http://www.pagestart.com

  • I have problem installtion, does anyone know how to use "Windows Setup Troubleshooter?"

    Original title: resolution of configuration issues.

    Does anyone know how to use "Windows Setup Troubleshooter"?  I have a problem installing and I found an article on WST but I can't find it when I search on my machine S2008-R2.  This is a feature I have to add, or is it a downloadable application?

    Hello

    Thanks for choosing Microsoft Community!

    If I understand correctly, you want the resolution of Windows installation problems.

    Please answer these questions:

    1. don't want to install the program on Windows Server 2008?

    2. what program you are not able to install?

    3. what happens when you try to install?

    If you have questions about Windows server 2008, you can ask the question here:

    http://social.technet.Microsoft.com/forums/en-us/category/WindowsServer

    If you have questions about the Windows 7 operating system, please respond with more information to help you further.

  • I keep getting out of memory errors when you use Windows Media Player.

    original title: of memory error

    Hi, I have a Windows 7 PC brand new with 12 GB of RAM, but I get low on errors of memory, especially when you use Windows Media Player. I tried:

    -Execution of the antivirus scans

    -Cleaning things out of the startup folder

    -Increase in the size of paging file

    I can't understand what the devil is the cause of this error - as I said, it's a new machine, and is not practically nothing on it yet.

    Any help is appreciated.

    Hello

    Follow these steps and check.

    (a) open 'command prompt' as an administrator (programs, accessories, right-click "command, prompt" run as administrator).

    (b) type the following without the quotes and press ENTER.

    "for %a in (% systemroot%\system32\wm*.dll) do regsvr32 /s %a.

  • How to use Window.Print button attributes

    Hello

    I want to print a report using an impression button.so I use the function Window.Print in button attributes. But pop print screen doesn't pop up. How to use Window.Print button attributes.


    Thank you
    Maury

    Maury,

    The value target button in the form of URL and put after js for target URL

    javascript:window.print();
    

    see you soon,
    Hari

  • How to use the license acquired from Win 7 cd to be used on my WinXP?

    Windows XP License Activation

    I have a copy of Windows XP on my PC where I tried registering online, he says that's not authentic. I bought a copy of Win7 with downgrade rights to Windows XP Pro. How to use the license acquired from Win 7 cd to be used on my WinXP? I could not afford a complete reinstallation because several drivers needed to work on my pc do not work with Win7.

    Thank you!

    Hello Emerson_1

    Microsoft does not sell Windows 7 with a downgrade to Windows XP and a valid key. You will need to provide your own key. This option is only available with OEM Windows 7 Professional systems. If you wish to continue using XP you will need 2 keys as indicated by JW.
    Windows 7 offers XP mode and you can use it if you have chosen.
  • How to use Skype to call from my computer to another computer

    Original title: how to call a computer to

    Hello

    I can't find the instructions on how to use Skype to call from my computer to another computer so that I can get the video. Help.

    TIA,

    RS

    For a first test, the simplest method is to organize before a time and date when you're both already connected to the internet and connected to Skype.

    Then, they appear as 'online' in your Skype contact list. And communicate with them through that. Do not use the phone number.

    You need to get them in your contact list, if they are not already in it.

    Skype: Add contact

    https://support.Skype.com/en/FAQ/FA3281/how-do-i-add-contacts-in-Skype-for-Windows-desktop

  • Where can I learn how to use creative cloud program from A to Z?

    Where can I learn how to use creative cloud program from A to Z?

    Creating cloud FAQ

  • How to use the API of PL/SQL DBFS

    Hi guys,.

    I re-post this question to see if someone can help out me. I'm trying to use the API of PL/SQL DBFS to manipulate the files stored in DBFS.

    Details of the environment:
    Windows 7 or 5.5 OEL (I tried both platforms)
    Database: Oracle DB EE 11.2.0.2
    IDE: SQLDeveloper on Windows 7

    I have two users, DBFS_USER, who is the shop owner DBFS and MYUSER that connects to the store to manipulate files using the API of PL/SQL DBFS.

    Creation scripts:
    -----------------
    Connect / as sysdba;

    Dbfs_ts CREATE TABLESPACE DATAFILE 'D:\oracle\oradata\orcl\dbfs01.dbf' SIZE 1 M AUTOEXTEND ON NEXT 1 M;

    -create users
    create dbfs_user user identified by dbfs_user quota default tablespace unlimited dbfs_ts on dbfs_ts;
    create myuser identified by myuser;

    -grant the role
    GRANT RESOURCES, CREATE VIEW, CREATE SESSION, DBFS_ROLE, CREATE TABLE TO dbfs_user.
    GRANT RESOURCES, CREATE VIEW, CREATE SESSION, DBFS_ROLE, CREATE TABLE TO myuser.

    -create a filesystem (such as DBFS_USER)
    connect dbfs_user/dbfs_user;

    exec dbms_dbfs_sfs.createFilesystem ('STAGING_AREA_FS');

    exec dbms_dbfs_content.registerStore ('STAGING_AREA_FS', 'posix', 'DBMS_DBFS_SFS');

    dbms_dbfs_content.mountStore exec ('STAGING_AREA_FS', 'staging_area');

    commit;

    -export store STAGING_AREA_FS (as DBFS_USER)

    exec dbms_dbfs_sfs.exportFilesystem ('STAGING_AREA_FS');

    -Check the names of table (like MYUSER)
    connect myuser/myuser;

    -He can't see (without brackets)
    Select * from table (dbms_dbfs_content.listMounts);

    -Note at the bottom of the table table_name
    Select * from table (dbms_dbfs_sfs.listTables);

    -Mount as MYUSER (example with SFS table_name $ _FST_32)
    dbms_dbfs_sfs.registerFilesystem exec ('MYUSER_FS', 'DBFS_USER', ' FS$ _FST_32');

    exec dbms_dbfs_content.registerStore ('MYUSER_FS', 'posix', 'DBMS_DBFS_SFS');

    dbms_dbfs_content.mountStore exec ('MYUSER_FS', 'staging_area');

    commit;

    -verification of Mount (like MYUSER)

    Select * from table (dbms_dbfs_content.listMounts);

    Select the path in dbfs_content;


    CREATE a STORED PROC (like MYUSER)
    ----------------------------

    CREATE OR REPLACE PACKAGE MYUSER_PKG

    CreateDirectory function
    (P_File_Path IN VARCHAR2,
    P_ErrMsg OUT VARCHAR2)
    return number;

    END MYUSER_PKG;

    /


    CREATE OR REPLACE PACKAGE BODY MYUSER_PKG

    CreateDirectory function
    (P_File_Path IN VARCHAR2,
    P_ErrMsg OUT VARCHAR2)
    Return number
    IS
    l_Return NUMBER;
    l_props DBMS_DBFS_CONTENT. PROPERTIES_T;
    BEGIN
    l_Return: = 0;

    () DBMS_DBFS_CONTENT.createDirectory
    path = > P_File_Path,
    Properties = > l_props);

    RETURN l_Return;
    EXCEPTION
    WHILE OTHERS THEN
    l_Return: = NVL (SQLCODE,-1);
    P_ErrMsg: = SQLERRM;
    RETURN l_Return;
    CreateDirectory END;

    END MYUSER_PKG;

    /

    When you compile the package, I get this error:
    Error (9,11): PLS-00201: identifier 'DBMS_DBFS_CONTENT' must be declared
    Error (9,11): PL/SQL: ignored element
    Error (13.3): PL/SQL: statement ignored
    Error (15,19): PLS-00320: the declaration of the type of the expression is incomplete or incorrect

    How can I solve the problem in the error message? I'm not an expert in DB. I used this reference documentation: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e18294/adlob_client.htm#CIHDEJAA

    Thanks in advance.

    CAPPA

    You must directly grant the privileges of DBFS_ROLE because roles are not enabled in stored PL/SQL:

    SQL> select* from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Solaris: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    
    SQL> show user
    USER is "SYS"
    SQL>
    SQL> create user myuser identified by myuser;
    
    User created.
    
    SQL> GRANT CREATE SESSION, RESOURCE, CREATE VIEW, DBFS_ROLE, CREATE TABLE TO myuser;
    
    Grant succeeded.
    
    SQL>
    SQL> begin
      2  for x in (select privilege, table_name
      3           from dba_tab_privs
      4           where grantee='DBFS_ROLE')
      5  loop
      6   execute immediate 'grant ' || x.privilege || ' on ' || x.table_name
      7   || ' to myuser ';
      8  end loop;
      9  end;
     10  /
    begin
    *
    ERROR at line 1:
    ORA-22812: cannot reference nested table column's storage table
    ORA-06512: at line 6
    
    SQL>
    SQL> connect myuser/myuser
    Connected.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE MYUSER_PKG IS
      2  Function CreateDirectory
      3  (P_File_Path IN VARCHAR2,
      4  P_ErrMsg OUT VARCHAR2)
      5  return Number;
      6  END MYUSER_PKG ;
      7  /
    
    Package created.
    
    SQL> show errors
    No errors.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE BODY MYUSER_PKG  IS
      2  Function CreateDirectory
      3  (P_File_Path IN VARCHAR2,
      4  P_ErrMsg OUT VARCHAR2)
      5  return Number
      6  IS
      7  l_Return NUMBER;
      8  l_props DBMS_DBFS_CONTENT.PROPERTIES_T;
      9  BEGIN
     10  l_Return := 0;
     11  DBMS_DBFS_CONTENT.createDirectory (
     12  path => P_File_Path,
     13  properties => l_props);
     14  RETURN l_Return;
     15  EXCEPTION
     16  WHEN OTHERS THEN
     17  l_Return := NVL(SQLCODE, -1);
     18  P_ErrMsg := SQLERRM;
     19  RETURN l_Return;
     20  END CreateDirectory;
     21  END MYUSER_PKG ;
     22  /
    
    Package body created.
    
    SQL> show errors
    No errors.
    

    You should check why some GRANT statement fails if you have another problem with the other piece of code.

  • How to use Windows Mail instead of Windows Live in IE9?

    I can't receive my mail from my Windows Mail account, and I don't want to use Windows Live.  How can I change my e-mail back to Windows Mail?

    Your question belongs to another forum. Is she not here.

    IE9 has nothing to do with Windows Live Mail or Windows Mail. It's a browser.

    Windows Mail: Setting up an account of end-to-end
    http://Windows.Microsoft.com/en-us/Windows-Vista/Windows-mail-setting-up-an-account-from-start-to-finish

  • How to use Windows backup with USB

    When I try to back up using Windows 7 backup and restore I get the following message: "Please write the following label on a blank media and insert in E:\. ». When I then click OK, I get this message: "there is no media in the drive.  And when I click OK on that I get this: "he has no media.  Backup Windows needs a CD/DVD or USB drive to continue.  Insert the required one.  This despite the fact that I have a direct on the USB flash drive and I can manually save him.  Can I go back to a flash drive using Windows backup and if so, how?

    You will need to rerun Setup and choose the drive flash under the saving location for.

    http://Windows.Microsoft.com/en-us/Windows7/products/features/backup-and-restore

  • How change using Windows 7 Ultimate file Access Denied so can access.

    Using Windows 7 Ultimate I am the administrator of the computer. I use MSN to my browser window and tried to move my list of favourites on IE (which is not easy). MSN browser does not allow export of a file. MSN told me to locate the MSN folder # in the application Data folder but I'm here and I'm denied. Where can I make changes that allows me to access this folder?

    Anyone who knows an easy way to move this folder Favorites let me know. So far MSN of course does not help. Frustrating!

    Thank you

    James

    Hi James,

    If you want to give all permissions for each files and folders, you must give permission to the root of the drive (means where the operating system is installed), but give permission to the root of the drive can cause serious problems (such as data loss or incompatibility and registry entry edit permission).

    You can see the previous post to change permissions.

    Warning:  Important this section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    322756 (http://support.microsoft.com/kb/322756/)

    How to back up and restore the registry in Windows

    Hope the above information is helpful.

Maybe you are looking for