LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory deallocation

Hi,
 
I am facing problem of deallocating memory. If before running the project, used memory is X MB, then after running, the used memory should come back around X MB. But I can see an additional 50 MB added to used memory. This is shows that VI(s) are holding memory even after running.
 
VI(s) are using queues, reentrant subvi(s), gobal variables and normal operation functions.
 
I tried deallocating by placing "Request Deallocation" function (which is present in application control-> memory control) inside one of my subvi(s) . But there was no result. May be I didnt use it correctly.
 
Any more suggestions regarding memory deallocation.
 
 
0 Kudos
Message 1 of 6
(3,487 Views)
This is just one possibility, but if you're calling named queues in a loop, and using them in other VIs, they will retain memory space until you expressly release them all (or use the Force Destroy option) or until all of the calling VIs have stopped.  Also, for a broad question like this, it will always be helpful to post whatever code you can.
0 Kudos
Message 2 of 6
(3,477 Views)
Another likely possibility is that you have indicators that are displaying lots of data. Even after the VI stops running, those indicators require the memory in order to display the data.
0 Kudos
Message 3 of 6
(3,473 Views)


vimalt wrote:
I am facing problem of deallocating memory. If before running the project, used memory is X MB, then after running, the used memory should come back around X MB. But I can see an additional 50 MB added to used memory. This is shows that VI(s) are holding memory even after running.

Also please don't go on a misguided and useless witch hunt here. Maybe this is a non-issues.
 
Unless (a) the memory does not return after closing the project or (b) the memory footprint increases by another 50MB every time you run the program, there is no problem.
 
Most likely it would be much less efficient if LabVIEW would release these 50MB, just to reallocate them again the next tiem you run the code again.
 
What makes you think that there is a problem? Do you get out of memory errors? excessive swapping? Performance issues? Most likely you're a barking up the wrong tree. Trust me. 🙂
0 Kudos
Message 4 of 6
(3,466 Views)

hello  Knight of NI ,

 

As you said in your reply that it hardly matters if the memory figure does not reach to its previous figure and it is not a big problem to think upon.

But as far as deallocation of the VI is is concerned, i am facing the problem of memory performance in terms of memory leakage in the code developed by us.

A large numbers of shared variables are used and If deallocated a sub vi having shared variables does it actually deallocates the memory acquired by it.

We are having this a big problem in front of us as nothing of our remedies had actually cured us from the problem of mamory leakage and we are constantly facing this.

I had also read a document in the discussion forum as if a bundle array function is used in a continuous loop it could be the cause of the problem leading to memory leakage and the possible solution is to replace build array with replace array subset. We had used build arrays and replaced it as per the suggestion.

We also done this but the problem still remains.

We had approached NI India for the solution.

How this Memory Leakage happens and what is this memory leakage. We had also increased the virtual memory and paging memory.

Please suggest any possible solution.

 

Thanks & Regards,

Samriddh Sarbalhi

0 Kudos
Message 5 of 6
(3,265 Views)

hello Member vimalt ,

 

As altenbatch said in his reply that it hardly matters if the memory figure does not reach to its previous figure and it is not a big problem to think upon.

But as far as deallocation of the VI is is concerned, i am facing the problem of memory performance in terms of memory leakage in the code developed by us.

A large numbers of shared variables are used and If deallocated a sub vi having shared variables does it actually deallocates the memory acquired by it.

We are having this a big problem in front of us as nothing of our remedies had actually cured us from the problem of mamory leakage and we are constantly facing this.

I had also read a document in the discussion forum as if a bundle array function is used in a continuous loop it could be the cause of the problem leading to memory leakage and the possible solution is to replace build array with replace array subset. We had used build arrays and replaced it as per the suggestion.

We also done this but the problem still remains.

We had approached NI India for the solution.

How this Memory Leakage happens and what is this memory leakage. We had also increased the virtual memory and paging memory.

Please suggest any possible solution as you had been in this problem in the past and how you tackled it.

 

Thanks & Regards,

Samriddh Sarbalhi

0 Kudos
Message 6 of 6
(3,264 Views)