LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital waveform memory leak LabVIEW 8.6.1

For about two weeks I've been trying to track down a memory leak in a large application developed in LabVIEW 8.6.1. The compiled executable would keep growing in size at a rate of approx 2.5 MB an hour.  We only discovered the problem after ~200hours of operation.

Among many other things, the application generated digital waveforms and clocked them out of an M-series DAQ as an SPI signal .

 

I spent hours using the 'profile performance and memory' tool to no avail. It showed NOTHING was leaking.

It only seemed to leak in the compiled executable... so I thought. It turns out the LabVIEW.exe process was leaking when running the code in the development environment, I just didn't notice.

 

By systematically isolating sections of code then simplifying it down, a colleague and I traced the problem down to some specific circumstances manipulating digital waveforms.

 

The attached zip file contains 2 seemingly innocuous vis. They serve no purpose other than to demonstrate the leak. The do not actually manipulate the digital waveform. All they do is run it in a for loop, outputting two different size waveforms.

 

According to the 'profile performance and memory' tool, it doesn't leak. But (in LabVIEW 8.6.1) if you check the LabVIEW.exe process memory usage, it just keeps growing.

If you compile it to an exe, the exe will keep growing.

 

We modified the vi in all sorts of ways, some scenarios reproduced the leak, others didn't. Without being able to tie it down exactly, we can't come up with a work around.

Our code that generates the SPI is much more complicated and seems to leak faster. The only workaround we have is to upgrade all our code to LabVIEW 2009.

 

We've tested this on 3 different PCs in the development environment (although they're all HP workstations) and a few other PCs (Dells etc) as a compiled executable. They all leak.

 

This is a problem in LabVIEW 8.6.1. I haven't tested earlier versions, but it seems to be fixed (or at least dramatically improved) in LabVIEW 2009.

 

So if you're using LabVIEW 8.6.1 with digital waveforms and you find your application has an inexplicable leak, now you know what may be going on.

 

This problem should at least be noted in the LabVIEW 8.6.x known issues

 

Perhaps someone out there can confirm if the attached vi leaks on their setup too (LabVIEW 8.6.1) and can maybe narrow it down further or come up with an explanation.

Just run the 'digital waveform leak.vi' and watch the LabVIEW.exe process memory ('for loop.vi' is just a subvi. We can get it to leak without a subvi, it's just more complicated.)

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 1 of 3
(2,918 Views)

Hello Troy,

 

I ran the VI on my machine with LabVIEW 8.6.1 and I noticed the same behavior. I also noticed that the 'profile performance and memory' tool didn't record this memory leak either. I have notified our R&D department of this problem through a corrective action report. This report number for this problem is 223376 so you will know which version this has been fixed in. For now though, I was able to stop this memory leak by adding indictators on the For Loop VI output. I have also tested this in LabVIEW 2009 and I couldn't reproduce the memory leak there.

 

I hope this information helps you with your application and if you need any more assistance please feel free to post.

 

JimS.

Jim St
National Instruments
RF Product Support Engineer
0 Kudos
Message 2 of 3
(2,886 Views)

Thank you for confirming/verifying and raising a corrective action request.

 

So where do we send our invoice for 2 weeks of debugging? Smiley Wink

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 3 of 3
(2,884 Views)