08-27-2009 11:45 AM
I found this
That will leak memory as well.
Open once before and close after.
Ben
08-27-2009 11:47 AM
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.
08-27-2009 12:01 PM
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
08-27-2009 12:13 PM
08-27-2009 12:21 PM
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.
08-27-2009 12:30 PM - edited 08-27-2009 12:31 PM
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.