> Can any one tell me if an initialized shift register remembers its
> contents between calls to the vi? I use a shift register to hold an
> array of complex clusters, and if this information is not eliminated
> between calls, this would represent a very large waste of physical
> memory. If this is the case, is there any way to force LV to clear the
> memspace of this one vi ASAP ?
>
Initialized Shift registers do not have side effects between calls,
in other words, the previous data isn't used in the next call. That
doesn't mean that the data is released though. The buffer for the
array is kept around assuming that the next call will have a similar
sized array that needs to be stored. In essence it trades memory for
speed and optimizes for the execution speed.
You could turn on the Deallocate Memory preference on the performance
page, but I wouldn't advise it. This setting is global and the frequent
resizing can actually make the system memory manager fragment worse and
use more memory than before due to the fact that most system memory
managers never compact. Instead, I'd recommend that you selectively empty
the shift registers yourself. You can write anything you want to the shift
register on right hand side on the last iteration. This means that the last
iteration of your loop, set the value to an empty array or whatever you like.
If you need the value previously stored in the shift register, then you
should send the value out of the loop in a tunnel rather than the shift
register.
Greg McKaskle