LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to free up RAM after showing data in Graph?

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

0 Kudos
Message 1 of 6
(2,543 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(2,537 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 6
(2,526 Views)

> 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.

0 Kudos
Message 4 of 6
(2,520 Views)

Hi One,

 

see crossrulz comment on my message. I agree with him…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(2,517 Views)

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?

0 Kudos
Message 6 of 6
(2,505 Views)