Stack structure, media and memory?

J. Landman Gay jacque at hyperactivesw.com
Fri Feb 17 14:43:42 EST 2006


Ken Apthorpe wrote:

> However, I can't find info on what exactly happens to loaded media when a
> card (or substack) is closed, in terms of memory purging.  I've had other
> stand alone media-heavy apps hang because of memory overload so it's an
> issue for me.

This is never an issue in Revolution. Memory is handled automatically. 
When a card is closed, the memory its media used is recycled. It also 
makes excellent use of virtual memory as necessary. You don't even have 
to think about it. All you really need to know is that you'll need 
enough RAM initially to load the entire stackfile (about as much as the 
file size of your stack on disk; this includes the substacks in the 
file, of course.)

That is the advantage to using external media files, rather than 
embedding them into the stack. A referenced media file will be unloaded 
when it is no longer needed, and it doesn't count as part of the stack 
size when the stack is opened in RAM. Movie files, audio files, and 
other large media files should, in general, always be referenced from 
disk. You won't have to worry about memory if you do that.

If you want to worry about it anyway, you can always just set the 
filename of the player in question to empty. That removes all the media 
content and clears memory. But you really don't have to do that.

If you are replacing one movie in a player with another (by changing the 
player's filename reference) then memory is swapped as needed. The old 
file is dumped and the new media is loaded.


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list