LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW: Memory is full.

Hi all,

 

I developed a program that performs a life test on a unit by actuating the unit every few seconds for thousands of times.  The program continuously processes and logs a value of flow (gallons per minute).

 

I have been using this program without issue but the program abruptly stopped and I received the following message:

 

"LabVIEW: Memory is full.

 

The top-level VI "Manual_Faucet_Cycle.vi" was stopped at unknown on the block diagram of "FGV_Flow.vi".

 

Refer to the VI Memory Usage topic in the LabVIEW Help for suggestions on monitoring and improving VI memory usage."

 

The functional global variable FGV_Flow.vi is what I am using to transfer the flow data between loops.

 

I have attached my project. I tried to attach the entire contents of the project but it exceeded the upload limit.  Hopefully what I attached is sufficient.  Can someone please provide some advice?  Thank you!

 

 

Download All
0 Kudos
Message 1 of 5
(2,487 Views)

Your code uses Build Array repeatedly, forever.

At some point you will always run out of memory.

 

You can consider using something like a Circular Buffer to overwrite/discard old data if you want to keep the most recent "N" data elements, or you can write to disk and remove from memory as needed. You can use some combination to keep a large chunk in memory, and only write once it becomes "N" hours/days/weeks old, depending on how quickly you exhaust your available memory.

 

You can also (if you're not already) consider trying to use 64-bit LabVIEW, which doesn't solve the problem but could postpone it long enough that you don't see it (but if you really run forever, you'll still get there eventually).


GCentral
0 Kudos
Message 2 of 5
(2,479 Views)

@cbutcher wrote:

Your code uses Build Array repeatedly, forever.

At some point you will always run out of memory.

 

You can consider using something like a Circular Buffer to overwrite/discard old data if you want to keep the most recent "N" data elements, or you can write to disk and remove from memory as needed....


I used to develop those before polymorphic queues were added to our arsenal. But since then no need.

 

A fixed size lossy queue will the same thing and you can preview the queue if you want to grab everything but leave the queue contents intact.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 5
(2,474 Views)

thank you for the advise!

 

when you say my code uses build array, are you referring to the FGV_Flow.vi "SetFlow" case?  See image below.  Also is there an example of how I can implement the circular buffer?  Thank you!

0 Kudos
Message 4 of 5
(2,461 Views)

A) Yes.

B) The suggestion to use a fixed length queue is likely the simplest solution for a circular buffer. The key lies in setting a limited size (not the default -1) when using Obtain Queue and then enqueing using Lossy Enqueue Element.


GCentral
Message 5 of 5
(2,448 Views)