Rules governing stack purging

Richard Gaskin ambassador at
Tue Oct 31 14:46:29 EST 2006

Trevor DeVore wrote:

> On Oct 31, 2006, at 11:08 AM, Richard Gaskin wrote:
>> The destroyStack property is used to govern whether a stack remains  
>> in memory when using "go" or "open", but it not honored when a  
>> property within a stack is accessed.
>> By honoring the destroyStack property consistently, accessing  
>> properties of stacks which have this set to true would cause the  
>> engine to read the file, obtain the data, dispose of the copy of  
>> the stack in memory, and return the value requested.
> I guess in my mind the current behavior makes sense.  I see a read of  
> a property as something that reads a property, bringing it into  
> memory if need be to complete the operation.  You approach it as the  
> reading of the property being an open/read/close operation so  
> destroyStack should come into play.  Is that correct?


By its nature, the act of reading any part of a stack causes the stack 
file to be read into memory, where it's parsed to obtain the requested 

So in essence it's another form of opening a file, and that the engine 
currently leaves the file in memory reinforces this.

Accessing properties in stacks is roughly equivalent to locking messages 
and opening the stack invisibly, in almost all respects except that the 
stack does not appear in windows().

Given the nature of the behavior, it seems to me that anything which 
causes a stackfile to be read into memory should follow the same memory 
management rules.

  Richard Gaskin
  Fourth World Media Corporation
  Ambassador at

More information about the use-livecode mailing list