LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does aborting a dynamically launched VI prevent it from deallocating memory

Hi,

 

I am trying to document some code written by another developer and don't actually have access to execute the program. Basically, I have found that he dynamically launches a VI that contains three frames within a sequence diagram. The first frame takes care of some quick variable initialization. The second frame is more of a "processing" frame and contains an event structure nested inside of a while loop. The final frame requests that the VI memory get deallocated and then terminates the VI by calling a subvi which uses the VI reference to set the FP.Open property to false and then Abort VI.

 

Typically, I would have expected the developer to wire in a "close" event tied to a bool control that is then signaled to terminate the while loop / event structure in the "processing" frame of the sequence. This would then trigger the final frame that would "kill" the VI. HOWEVER, what actually happens is that it seems this VI is allowed to execute until a separate dynamically launched VI (which actually started the VI with the "processing" frame) shuts down the "processing" VI by calling FP.Close followed by Abort VI on the VI reference.

 

My question is whether or not the "processing" VI would be allowed to enter the final execution frame and request deallocation? Or, would this result in a memory leak (the VI that is terminated is updated with images so I would think that a memory leak would be easily detectable unless LabVIEW is doing a good job of automatically freeing this memory).

 

Thanks for any guidance!

Justin

0 Kudos
Message 1 of 2
(2,336 Views)

Justin,

 

I believe I have a grasp on whats going on in your colleagues code and it sounds like the VI is being aborted externally.  If the while loop in the 2nd sequence never ends then the fp.close and request deallocation are not likely being executed.  Do you see a memory leak in windows task manager?  The garbage clean up built into LabVIEW will most likely clean up any memory but you are right you could create a leak.

 

Best,

Chris LS

National Instruments
Applications Engineer

Visit ni.com/gettingstarted for step-by-step help in setting up your system.
0 Kudos
Message 2 of 2
(2,323 Views)