A memory management issue

Richard D. Miller wow at together.net
Fri Jan 4 14:26:00 EST 2002


I'm building a project that will have a total of 1,650 cards, with each card
containing one field holding approximately 20k of formatted text.

I was thinking of splitting this into 4-5 separate substacks, each being
about 4-5 MB in size.

The main stack would contain an index to all 1,650 cards, from which the
user can pull up information on any one card. My concern is with minimizing
memory requirements.

My understanding is that as soon as the main stack is opened, all 20 MB's
worth of substacks will be pulled into RAM as well...which I don't think
will work for my average customer.

I realize I could make each substack into a main stack instead, and
theoretically copy the contents of a formatted field from any given card in
one of those stacks into a field in my primary main stack (which is not
large in size). Then I would have to immediately use the destroystacks()
function to purge that data stack from memory. I could basically swap data
stacks into and out of memory, but this seems like a rather ugly approach.
Perhaps it's the best way, though.

Suggestions?
Richard Miller




More information about the use-livecode mailing list