From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory and CPU usage rising

Hello All,

i have vi that get cluster reference as input and select from its controls some control by using property "Controls[]" and Index Array and returns its property out.
Then i use this vi in while loop in another vi.
The problem is that memory usage and CPU usage reachs after some minuts 100%. If i delete using Index Array, problem desappears.

Look example of this VIs.
Where is problem?
0 Kudos
Message 1 of 6
(2,841 Views)
The type definition is not included (so, it cannot be executed) but I guess that the problem is related to references. Try to close both (it depends on type, sometimes it must be closed) and obtained after Index Array.

Hope this helps
Message 2 of 6
(2,841 Views)
Thanks.

I closed reference to all controls of cluster after using Index Array and this helped.
0 Kudos
Message 4 of 6
(2,841 Views)
Make sure you close any reference you open (explecitly or implicitly).

If you are going to access a control repeatedly, get the reference ONCE and re-use until done.

I have reason to suspect that LV does note release all resources after use. I can not prove this.

I will try to check your posting when I get back to the office.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 6
(2,841 Views)
Thanks, Ben.

Closing reference of all cluster controls helped.

But i don't understand why the problem occured only if i used Index Array for control refernce obtaining.
Without this, the problem don't exist.
0 Kudos
Message 5 of 6
(2,841 Views)
Somewhere along the line I read that that LV is smart enough to decide if an output of a node is used. If not, the code is skipped.

Without the Indexing the reading of control ref would be skipped.

Just my guess.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(2,841 Views)