12-26-2009 10:31 AM
12-26-2009 10:39 AM
12-26-2009 11:32 AM
To add:
You will get the same notifier each iteration if you use a named notifier (and execution time will increase unmeasurable).
But: If you use occurances, you will always get the same occurance.
Felix
12-26-2009 05:45 PM
Ravens Fan wrote:
... it will slowly eat up the resources until the program finally crashes when it runs out of memory.
Come to think of it, a notifier is just a reference, which is basically an integer value , so I wonder which would happen first - hitting the boundary of an I32 or running out of memory due to references not being closed. I had a similar situation a few years back in which I hit the former due to a coding error (obviously), but I don't remember if I was working with notifiers or queues. Does LV 2009 work any better at "garbage collecting" in closing references that are no longer "referenced"?
12-26-2009 11:45 PM
smercurio_fc wrote:
...which would happen first - hitting the boundary of an I32 or running out of memory due to references not being closed.
Well, 2^31*4 is roughly 8 GB or RAM, so I'm guessing you'll run out of memory on a 32 bit system and possibly reach the limit if you're on a 64 bit system with enough RAM. Also, I'm guessing the reference pool is shared by other resources (like queues), so you probably can't use all of it to allocate notifiers.
That said, your experience seems to indicate otherwise (assuming your memory is trustworthy 😉 ).
Does LV 2009 work any better at "garbage collecting" in closing references that are no longer "referenced"?
I'm guessing the answer is no and that if you allocate a reference which you don't use, it will remain in memory until that hierarchy goes idle. LV does have an optimization where code whose outputs are not used isn't executed at all, but I'm not sure if this applies to obtaining references as well, since that has further implications than just that point in the code.
12-27-2009 10:56 PM
Does LV 2009 work any better at "garbage collecting" in closing references that are no longer "referenced"?
LV2009 to my knowledge has the exact same method for cleaning up references as previous versions. When a VI goes idle (the top-level VI calling it stops), it cleans up all references it has opened that haven't been closed. It is not a good idea to wait for this to happen automatically.
Also, since notifiers can be named, it's difficult to know when they're no longer being referenced. At any time a new reference can be obtained by name.