LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Cost of SubVIs

Solved!
Go to solution

I have been exploring different options for reducing the memory consumption in my LabVIEW applications and have read many of the forum discussions and NI help/tutorials on the matter. 

 

I have observed that when I generate an array in a subVI as opposed to generating it in my top level VI it seems to cost me 1.5 times the memory allocation? I assume this is to do with the use of the indicator on the subVI (which I need to transfer my data from the sub VI to the main VI) but I had thought that subVIs shouldnt have such an additional memory cost.

 

I have attached two VIs which i have used to perform a test. I have outlined the steps involved in the test in the Front Panel of the main VI. Essentially I used Windows Task Manager to evaluate memory consumption when initialising a 3D array firstly in the Mian Vi and then using a sub VI. I found that the main VI method consumed 15.7MB approx and the sub VI method comsumed 23.5MB. 

 

Could someone help explain the additional memory cost and how I might be able to avoid it when using sub VIs?

 

Note: I have only used the initialise array concept as an example. What I am really trying to do here is get my head around areas where my LabVIEW applications are consuming memory and reduce memory cost where possible.

Download All
0 Kudos
Message 1 of 3
(2,185 Views)
Solution
Accepted by topic author kod

If you go into the VI properties for the subVI there should be an option to Inline into calling VIs on the Execution page.

 

This will eliminate the overhead of calling the subVI (make it as if the subVI code were part of the main VI).

 

Also make sure that you have debugging turned off for both the subVI and the main VI.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
Message 2 of 3
(2,163 Views)

Thanks Chris, turning off debugging did the trick.

0 Kudos
Message 3 of 3
(2,150 Views)