Jump to content

flush the memory


abedin

Recommended Posts

Hi guys.

I'm stuck with a problem here. Hope somebody will help me. Right now I'm developing a simulator that read input from CSV files. The problem is when i exit the simulator, the memory used to load the files still being use by LabView (200+mb viewed from task manager). Could I free those memory without exiting LabView or maybe programmatically flush the memory (while running the simulator)?

Thanks in advance.

Regards,

Abe

Link to comment
Make sure you close all the references before you end your app with "Close File", "Close Reference", "Release ...", "Destroy ...", or similar.

Thanks for the reply didierj.

I did close all the files and references but could you explain more about "Release" ,"Destroy"? I never found that before. By the way, i used couple of variables on arrays in my program. Does it effect the memory? If it does, how to free it?

Regards,

Abe

Link to comment

1. With "Release ..." or "Destroy ..." I mean e.g. "Release Queue", "Destroy Class" (if you use any sort of goop-objects, e.g. ini-files,...).

2. Memory management is done internally by LV. Usually you don't have to bother about it. I'm not absolutely sure, but thought it was so, LV doesn't give the allocated memory back to the operating system right by the way, but keeps it for future use.

Up to LV6.1 there was an option that was called "free memory as soon as possible". In LV7 this option has gone.

3. To have no memory leaks, make sure you close/destroy all references. they can be: queue refs, file refs, goop objects, refs to dynamically called vi's,...

Also make sure, when you display anything (esp. large arrays), that this vi get closed. As long as the vi is visible or loaded, the memory it uses won't be released. A vi is kept loaded when there is a vi-server ref still hanging around somewhere in your LV-envionment, even when you close the vi.

Link to comment
By the way, i used couple of variables on arrays in my program. Does it effect the memory? If it does, how to free it?

Hi Abe:

If you assign an array to a global variable (either to a true global or to a LV2 style global) that data will remain in memory until all the vis that call it are closed. So if you are storing a big bunch of data in a global, and not doing something specific to clear it out when you are through with it, that might be the problem.

If you can, try to do project with real dataflow wiring-- That way LabView should then know when its through with the data. If not, try writing an empty, (or very small) array to the global after you are through with it. That should at least make the memory available to your LabView application for other uses if it needs it.

Not sure if your problem is releasing memory for other programs to use, or releasing memory used in LabView for use elsewhere in LabView, but if you need the memory for LabView, the above suggestions should work. Its less likely, but they even might work if you need the memory for elsewhere in Windows.

Hope this helps, Louis

Link to comment
  • 2 weeks later...

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.