LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How To Reallocate Memory after daqmx Read

I have a User.lib vi that takes nimxio driver info from an .xml document. then type casts it to a nimxio task, and performs a daqmx read.  I execute this in a few loops throughout my code.  I've noticed that the allocated memory of the program grows out of control.  I tried to insert a "clear task", but that only allowed the vi to run properly once.  How can I continue to run this code in loops without the memory leak?

0 Kudos
Message 1 of 3
(2,873 Views)
After further debugging my code, I realized that my memory only increases when the Daqmx VI errors.  So it seems to be "daqmx fill in error info.vi" is where the allocated memory is growing.  Has anyone else experienced this?  Is there something fundamental that I am missing to prevent my memory allocation from growing out of control?

Thanks,
0 Kudos
Message 2 of 3
(2,857 Views)

I suspect that if your memory is growing, you may be having an array that sits inside a loop & grows along with it unchecked.

But it ll be difficult to tell you a correct solution without seeing your code.

Can you post it in part of full ?

Try to use the Request Deallocation function from the Functions -->> Advanced pallette after you finish your reading/writing part.

- Partha ( CLD until Oct 2027 🙂 )
Message 3 of 3
(2,854 Views)