LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How Many times does a Sub VI get loaded into memory?

If I call the same Sub VI from several different locations both within a Main VI and other Sub VIs. How many times does it get loaded into memory?
 
Which is more effecient memory wise calling by directly wiring the sub VI or calling using VI reference nodes?
 
Does this change once the VI is made into an executable?
0 Kudos
Message 1 of 3
(2,869 Views)

The VI will be in memory exactly once by default. However, if you set the subVI to reentrant, each instance will be independent. This does not change if you make it into an executable.

I would think wiring the subVI direclty is more efficient, but I don't have hard data. Why don't you try both and do some timing and memory profiling. 😉

0 Kudos
Message 2 of 3
(2,864 Views)
Thankyou I suspected it would only be once but wasnot sure.
 
I tried using both methods with some small VIs but the differences were in conclusive. Perhaps I need to try it on a dedicated machine with nothing else running and disconnected from our network to get consistant conclusive data.
So far it is not really important but as my VI's get larger it could become an issue??
0 Kudos
Message 3 of 3
(2,860 Views)