09-12-2014 07:13 AM
Hello,
my program collects data and stores it in a textfile.
On my panel i can open this textfile and show the data in an xy-graph. As my files are very big (>10MB) the used memory of the lv-application rises too.
The problem is only that i cannot clear it again.
If i open another file with only 10kB then the memory from before (+10MB) is still in use.
Is there a method like a garbage-collector in LV to free up the memory?
Only waiting (>1h does not free it up.
Thx
09-12-2014 07:35 AM - edited 09-12-2014 07:37 AM
Hi One,
the graph itself takes some RAM to store the plot data. So when you plot the content of that +10MB textfile your graph probably takes some MB just for storing the plots.
To free that memory you need to clear the plots by plotting empty arrays to the graph…
LabVIEW knowledge: each control/indicator stores it's own copy of the data. To minimize memory consumption you need to minimize control/indicator usage…
09-12-2014 07:52 AM
GerdW wrote:
the graph itself takes some RAM to store the plot data. So when you plot the content of that +10MB textfile your graph probably takes some MB just for storing the plots.
Not completely sure that will work. Some functions keep the maximum amount of memory that it ever needed since it was loaded. This is desired to prevent fragmenting your memory and it also speeds things up for later. The queue is a perfect example of this.
The sure-fire way to free the memory is to get that VI out of memory by closing down your program. Or, if you called it dynamically, let it close itself. You could also try the Request Deallocation node.
09-12-2014 08:01 AM
> To free that memory you need to clear the plots by plotting empty arrays to the graph…
I tried this by plotting another 10kb-file. Is not working.
09-12-2014 08:03 AM
09-12-2014 08:26 AM
I'm not sure the graph is your specific problem. In 2014, a simple graph example deallocates within a few seconds for me, dropping greater than 15MB when I reduce the graph data. Do you have any other "copies" of this data or other allocations (such as the aforementioned queues) that could grab memory and hold it until close?