LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does a vi not release memory even when arrays have been emptied?

I am reading a large amount of data from a disk file into arrays for graphing purposes. On exit I set the arrays to empty but can see using Task Manager/performance that a lot of the memory grabbed initially is not released. Why and how can I force it?
0 Kudos
Message 1 of 5
(2,910 Views)
Sounds like there is a copy of the arrays that is never deleted...but it's not good to tell without the code. You could try stripping away parts of the code and see if there is a certain part that keeps the memory (try loading the VI dynamically and then unload it completely, do you see the same efect?). Sometimes you can have memory fragmentation that will prevent the memroy from being deallocated.
0 Kudos
Message 2 of 5
(2,910 Views)
Thank you Mads - you've pointed me in a new direction.
0 Kudos
Message 3 of 5
(2,910 Views)
You can set under Tools>>Options>>Performance and Disk the "Deallocate memory as soon as possible" check box. This will release memory earlier than LV will normally do. It will increase runtime in the case when memory is allocated and freed often during the processing of the data.
In LV 7.0 under Advanced>>Data Manipulation is a function "Request Deallocation" which will release allocated memory. This way you have a more detailed control over the memory usage.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 4 of 5
(2,910 Views)
Thank you Waldemar but I should have mentioned I'm using LV 5.1.1 and I have set the Deallocate memory option.

Musketeer
0 Kudos
Message 5 of 5
(2,910 Views)