01-06-2012 10:31 AM
I am getting increased memory usage on a fairly complex program running LabVIEW 2009. It is a vision application and uses about 50 imaq buffers. These buffers are opened before the start of acquisition. Used during the run. Then disposed of. The memory increases after each run. I am using the latest IMAQ driver. It also uses net controls to control a motion device. When the memory gets to large, closing the VI does not fix it. Labview has to be closed and restarted. Any ideas on memory leaks in an application like this?
01-06-2012 10:45 AM
Very difficult to debug memory leaks from a discription. We're pretty sharp but not clairvoiant (Well most of the time)
Can you post your code- or break it down to the barest functions that still exhibit the sysmpoms?
01-06-2012 10:50 AM
I know it is vague. Just looking for know problems for labview 2009 related to this. Thanks.
01-06-2012 10:55 AM
Nothing I know of- It could be 1) a programming isue or 2) you might have hit a bug. if 1 we can probably help if 2 we really want to know![]()
01-06-2012 10:56 AM
Download the Desktop Execution Trace Toolkit. It has a thirty day trial but costs about $1K (Well worth it)
You can configure it to show memory allocations above a user defined threshold and see where it is being allocated. You can also set it to show unclosed references. Those show up highlighted in yellow. You don't want any yellow.
01-06-2012 10:57 AM - edited 01-06-2012 11:00 AM
Start throwing away functionality a piece at a time until you see the memory stop leaking.
I am unclear about how often the Vision and motino stuff get re-init.
If either or both get re-init between when the app is started and when you exit, then either or both may be leaking. I have recently worked with antoher poster with a leak that was traced back to the .net function.
Old Joke about Digital Equipment Field Engineers (of which I once was back when they were #2 behind IBM).
How does a DEC FSE know which tire to change?
He keeps swapping them until he finds the one that is flat.
So in your case keep tossing till you find the part(s) that leak.
And before I forget...
These tags are performance related. They may help you out.
Ben
01-06-2012 11:00 AM
Hmm. I'm not sure if DETT will show .NET leaks. Does anybody know if it will (too lazy to check
) and if not is there something from Microsoft that will?
01-06-2012 11:06 AM
Yea. I am in the mode of isolating it. Looking for known problems especially around .net and imaq buffers. Tried the profile window, but it causes an error when I start it. Divide and conquer until I find it I guess. I inherit lots of fun stuff.
01-06-2012 11:09 AM
DETT will give you a good starting point. I am not sure if you can get the trial for 2009 though.
01-06-2012 12:23 PM
Ernie, I noticed you're using .NET with a motor. I have a small leak with one of our main systems which occasionally uses vendor-supplied .NET LV code for the motor. Since we use that motor so seldom, I haven't trobleshot it much. What motor/controller is it?