Showing results for 
Search instead for 
Did you mean: 

Active X, MS Office Spreadsheet 11.0 Memory Leak



Can anyone see what I'm doing to cause a memory leak?  I am using LabVIEW 2011 (and this happens in 8.2.1 also).


Is the last Close Ref. needed because there's an allocation evey loop?


Is it bad that there's a buffer allocation on the right side of 'Value2'?


I've attached an image and the actual VI.








Download All
0 Kudos
Message 1 of 3

I would put the last Close Reference outside of the loop so that it only closes it once the loop is done.  You are actively trying to use that reference on each loop iteration.  I don't know what happens when you try to use a reference that is already closed.  It would either throw an error, or it could automatically try to reopen the reference, in which case repeatedly opening the same reference might lead to a memory leak.


Since you are using the same range on every loop iteration, I would consider moving the invoke node that gets the range ahead of the loop, and move the Close reference that closes the range reference to after the loop as well.

0 Kudos
Message 2 of 3

I added the last Close Ref. because there is a buffer allocation on the ref. input of the Range node, I couldn't think of anything else to do to reduce memory usage, and the close seems to reduce (but not eliminate) memory leakage.


I have the invoke node in the loop to simulate a more complicated situation that seems to be leaking memory and I want to exaggerate problems here so I know what should and should not be done.


I also suspect that I don't really have a good way of checking for memory leaks.  All I do is run the VI(s) and then watch Mem Usage for LabVIEW in my task manager. I see memory usage go up 1.M over about 70 minutes but it usually doesn't go up with other VIs.


Is Is there a better way?  Should I make a build of this VI and then use software that finds memory leaks?



0 Kudos
Message 3 of 3