12-14-2005 03:11 AM
12-14-2005 06:15 AM
Sebastian,
Memory leaks can be VERY hard to find. I use the divide and conquer technique that involves chunking (make into smaller code segments) your code into smaller pieces and running the smaller pieces until you find the memory leak. It can take weeks to find the source.
The most common is arrays or any data that increases in size as the program runs. To fix this you can use a FIFO that allows only so many elements to be added before deleting data out of the array. The second source is opening references repeatedly and not closing them. Look closely at any VI that open anything. Do a search for "Memory Leak" on the discussion forum and you will find about 60 postings that may help.
Matt
If you are using DAQ-MX http://digital.ni.com/public.nsf/allkb/BAF29EE03747EE4B86256E9700541436?OpenDocument
12-14-2005 09:40 AM
12-15-2005 07:36 PM - edited 12-15-2005 07:36 PM
Have you tried using the VI Profiler?
Ben
Message Edited by Ben on 12-15-2005 07:36 PM
12-16-2005 02:10 AM
12-16-2005 11:05 AM
03-27-2017 08:48 AM
Sabastian,
I am having the same memory leak issue in my LabVIEW GUI.
I am also accessing .NET dll calls, but within a TestStand sequence. My LV code is an operator interface that calls TS, sets up the environment, and then hides the TS code while running so that the only thing the operator sees is the LV GUI.
I exchange fileglobals and pass UI events to the GUI. The GUI is an event driven while loop. The GUI remains open until the operator hits the internal EXIT button. All events are unregistered and references closed before this GUI is allowed to exit.
However, the GUI memory is growing over time. After the GUI reaches almost 1GBytes, the object references I use for .NET dll calls is suddenly lost. I suspect this is due to Windows can't manage the object reference in memory with LV consuming all mem.
I also and ready for a Beta release at an international contract manufacturing site. This GUI code was developed by another person that I had to inherit, so I am just getting familiar with the logic.
I suspect I will have to file a help ticket with NI to get this resolved.
Thanks for sharing Sabastian, LV memory consumption is a big customer problem.