I just wonder in what kind of situtation the VI will exit memory after running and in what kind of stitutation the VI will stop running but still being used by the caller. For example, does the function" Close LV object reference" will make the VI exit memeory? Further more, how can i remove VI from memory after it stop running?
If you call vi by reference than after using "Close LV object reference" VI exit from memory. If you call vi usually it will be in memory all time caller is runing.
LabVIEW 6.1 ships with an application note entitled "LabVIEW? Performance and Memory Management". The first part of the document discusses how to use VI profiler but the latter part discusses how memory is managed and how the programmer can make better uses of resources. To find the document goto help and search for "memory management performance", You can also find the document on our web site http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/732cec772aa4fbe586256a37005541d3?OpenDocument
A VI is released from memory when a) its Front Panel is closed AND b) no running VI has a reference opened to the VI.
A VI can stay running in memory with its panel closed when it opens a reference to itself. The exeption is in a Run-Time executable, where the apllication quits when all VI Panels are closed.
' If the VI is reentrant, I agree that a peculiar instance of the VI is released from memory when the reference is closed but if the Front Panel of a VI is opened obviously that means that the VI is still loaded in memory. You can verify this reading the application property "All VIs in Memory".