LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does the "Sound File Read Open.vi" have a memory leak?

The memory usage in my vi is increasing without bonds. I have tracked this problem to the "Sound File Read Open.vi" in Labview 8.0.  What can I do to resolve this problem ASAP?
 
Please help,
 
Zach Barnes
Sr. System Engineer
DRS
Codem Systems, Inc
 
 
0 Kudos
Message 1 of 4
(2,998 Views)

I didn't find a VI in the palettes called "Sound File Read Open.vi"...I found "Sound File Read.vi" and "Sound File Open.vi"...are you talking about one of those?  If so, are you calling the Sound File Open.vi in a loop?  If so, are you neglecting to call "Sound File Close.vi" every iteration of the loop?  If so, that's your problem...every time you call Sound File Open.vi, it opens a new reference to a sound file, and these references will accumulate in memory over time.  I recommend you call the Sound File Open.vi outside the loop, and call Sound File Read.vi inside a loop, and once the loop is done, call Sound File Close.vi.  This should prevent any memory build-up of references (since you're only dealing with a single sound file reference).

If my guess above is not correct, please clarify which VI you're having a problem with, and if possible, attach a simple VI that demonstrates the problem.

Good luck,

-D

0 Kudos
Message 2 of 4
(2,989 Views)

Hi Darren.

 

The VI in the tool pallete is "Sound File Open", When I place it in my diagram the title is "Sound File Read Open". Remember, the leak only appears when the open file name is invalid. Attached find the use case.

 

Thank You

Zach

0 Kudos
Message 3 of 4
(2,977 Views)

Hi Zach,

Thanks for attaching a VI.  I agree that this code should not cause memory usage to increase, since you are closing the reference every loop iteration.  I will report this issue to LabVIEW R&D and hopefully we will see a fix in the next LabVIEW version.  For now, you can workaround the problem by checking the path to see if it is a valid path before attempting to open the sound file.

-D

0 Kudos
Message 4 of 4
(2,967 Views)