From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i clear memory that labview uses while running a VI?

Hi, I am acquiring images and storing them in memory. After each acquisition is done, images are saved from memory to harddisk, but memory does not clear. So after a series of acquisitions labview runs out of memory. The only time that memory is cleared is when i exit labview and restart. If i just close the running VI and reopen it the memory does not get clear. At the end of my saving loop, i use the flush que, is there any other function that i can use to totally clear the memory that labview allocates?
Thanks,
Christos

0 Kudos
Message 1 of 8
(11,593 Views)

If you program it right, LabVIEW should be able to re-use the same memory buffer for each image.

If the memory usage is in a subVI, yuo can request deallocation when that subVI finishes. (search the palette and help for "request deallocation").

Of course if your program is properly written to re-use the existing buffers, this function will decrease performance, because LabVIEW will need to reallocate the data with each new call. 

0 Kudos
Message 2 of 8
(11,588 Views)

Hello,

 

I´m having memory problems as well. The algorithm I´m working on requires the processing of large images. In general the program runs well. The problem comes when I want to save the file after modifications in the VI. LabView tells me that the memory is full.It´s quite weird, I have 16GB RAM,  and at the moment of saving less than 7GB are being used. I tried running the request deallocation at the end of the execution but not significant change was observed.I´m wondering if my 32bits-Labview Version hinders the use of my 16 GB RAM? 

Any help is highly appreciated.

 

Thanks

0 Kudos
Message 3 of 8
(7,871 Views)

Hello Arroyo,

 

my experiences with memory- overflow are as follows:

- if it takes a little amount of time to show the error- message, then an array is build inside a loop without appropriate end condition

- if the error- message is shown immediately, then I tried to use the "initialize array" function and the calculation of the size- parameter went wrong to some negative I32 value, which is converted to an U32 value with 4 Billion something elements.

 

But normally LabVIEW stops at the code causing the error.

 

 

Greets, Dave
0 Kudos
Message 4 of 8
(7,860 Views)

Hello Dave,

 

Thanks for your reply. Well, hard to say.As you said, it should be related to one big array within a loop. But I have several loops and arrays within the code and finding the problematic one would take ages.

If I run the program with a small image, make some changes and save it, it works fine. However, if I try the same with a large image I receive the notification that the memory is full.

I don´t really get why saving the code is affected by the input. I don´t want to save results, simply the code. 

Does somebody have any idea?

 

Best regards

0 Kudos
Message 5 of 8
(7,851 Views)
Yes, but the memory full message should tell you exactly where in the code you ran out of memory. That is the place to start looking.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 8
(7,838 Views)

how do i create arrays more efficiently.

 

LOL I just left the huge font because that's how the forum wanted the cut n paste and it was just funny.  (Indulge me, please - I just had my first cup of coffee.)  😄

 

Please see the thread above and all it's attendant links.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 8
(7,815 Views)

@Arroyo wrote:
I´m wondering if my 32bits-Labview Version hinders the use of my 16 GB RAM? 

This is absolutely the case - a 32-bit program cannot access more than 4GB RAM, regardless of the underlying processor and operating system. That said, no reasonable VI should require that much RAM in order to save. Are you displaying the images or huge arrays on the front panel? Do you have a huge array constant somewhere? What happens if you reinitialize all front panel controls and indicators to their default values (there's a menu command for this) prior to saving?

0 Kudos
Message 8 of 8
(7,799 Views)