abedin Posted December 15, 2005 Report Share Posted December 15, 2005 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 Quote Link to comment
didierj Posted December 15, 2005 Report Share Posted December 15, 2005 Make sure you close all the references before you end your app with "Close File", "Close Reference", "Release ...", "Destroy ...", or similar. Quote Link to comment
abedin Posted December 15, 2005 Author Report Share Posted December 15, 2005 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 Quote Link to comment
didierj Posted December 16, 2005 Report Share Posted December 16, 2005 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. Quote Link to comment
Louis Manfredi Posted December 16, 2005 Report Share Posted December 16, 2005 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 Quote Link to comment
Michael Aivaliotis Posted December 17, 2005 Report Share Posted December 17, 2005 Up to LV6.1 there was an option that was called "free memory as soon as possible". In LV7 this option has gone. Yes, but it's now available as a function: Quote Link to comment
abedin Posted December 28, 2005 Author Report Share Posted December 28, 2005 Thanks guys for the help. :thumbup: You all are really something. I don't know how long it gonna takes me to reach the level as you guys right now.... Regards, Abe Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.