LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

erro in help for LV 2009- For Loops and While Loops

I found this

 

 

Open_Close_Leaks.PNG

 

That will leak memory as well.

 

Open once before and close after.

 

Ben

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

Is that an error? That seems like it would be expected, each Open Reference should allocate memory.

Probably bad coding practice, but expected results I guess.

Cory K
0 Kudos
Message 2 of 6
(2,827 Views)

Cory K wrote:

Is that an error? That seems like it would be expected, each Open Reference should allocate memory.

Probably bad coding practice, but expected results I guess.


I believe the documentaion is in error if THAT is the THAT you were refering to.

 

Opens should be performed as infrequently as possible.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 6
(2,820 Views)
Ahh, so you are saying that they shouldnt even suggest opening a reference within a loop?
Cory K
0 Kudos
Message 4 of 6
(2,815 Views)

If absolutely required well then you have no choice. Every open allocates memory.

 

To prove to yourself...

 

Before you go home on Friday afternoon write a VI that repeatedly opens a closes a VISA ref in a While loop with no delays.

 

Note the amount of memory used when you start the app then let it run over the week-end.

 

Monday morning your will find more memory being used than Friday.

 

Stop the app and exit LV and watch the effects on the memory usage.

 

Bottom Line:

 

Every open allocates a small amount of memory that is  generally* NOT released until LV exits. 

 

Ben

 

* I have not experimented with explicitly releaseing the memory of the VI to see if it affect the memory usage.

 

 

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

That little note is not new in LV 2009 - it's been there in earlier versions as well. I think that note is referring to a situation such as this:

 

Running it in highlight mode indicates a new reference number at the probe. In this case you can't open the reference outside the loop (e.g., if you wire in an array of control references). In this respect I think the note is correct.

Message Edited by smercurio_fc on 08-27-2009 12:31 PM
Message 6 of 6
(2,798 Views)