Jump to content

why did the memory change big


Recommended Posts

I have finished a software with the labsql,but when the software runs ,the used momory becomes bigger an bigger.at the begining ,memory is 41M,serveral hours later,it is over110M :question:

thank you

Quite hard to give any advice, since there is not too much info.

From what you said, it seems to me, that you open references to the sql-objects, but not close them. Check that every single call to "open reference" is followed (after the work on this reference is done) by a call to "close reference".

Didier

Link to comment

There are many things that can contribute to memory issues. The following is a list of common mistakes I have made in the past that can add to the bulkyness of code:

1) Look for the use of the Build Array function within a loop. If I remember Correctly this causes an additional copy of the array to be created each execution of the loop. This can be solved by initializing the array outside of the loop and using the insert into array function within it. The concatenate string functions works in a similar way to the build array as well.

2) Watch out for the use of Local and Global Variables. Local Variables cause a front panel to remain in memory even after the VI's execution has ended ( so sub vi's that use these in the background will stay in memory). Global Variables will create an additional copy of the data each time that the Global Variable appears in the code.

3) Clusters that contain clusters can also be an issue, because as you unbundle the data it will create additional copies in memory instead of referencing the original data.

Hopefully some of this information is as helpful to you as it was for me.

Good Luck,

Dave Graybeal

Link to comment
i close the database everytime .how can i free the memory?

another condition :the used memory change little when operateing ActiveX(Access) operate database .why?

i have to admit, i am not a user of LabSQL, but as far as i know, it uses ADO / ActiveX. Somewhere in the palettes there has to be a function which does the following:

post-885-1141241722.png?width=400

the 2D Array of Variant is sored somewhere in the memory of your computer. LabVIEW gets the pointer to this region. If you send a select query without closing that pointer (=freeing the memory) the pointer holds an address of a new memory segment and the old segment is "lost", but the memory is still marked as "used" and is unavailiabe for other applications. with every new sql query, that does not free the memory after taking the data into your programm, the ammount of used memory is increasing

maybe someone with deeper knowledge of LabSQL can help you out, finding the appropriate VI?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.