If I keep this thread up, eventually I'll be able to use some really cool 
names... "Beneath the Planet of RAM Questions, RAM Question vs. Godzilla, I
Was a Teenage RAM Question...."

Anyway, I found something interesting (and probably already obvious to some
folks).  I was having a problem when I opened a stack with a field that had
about 1 MB worth of data, and then loaded that data into RAM... the process
added over 10 MB to my app's RAM consumption.

I took the same data and put it into a text file, then instead of opening
the stack and loading the field into RAM, I just opened the text file and
loaded IT into RAM.  What a difference!  Instead of adding over 10 MB to my
RAM consumption, it added slightly under 4 MB.  And when I dumped it, I got
about 3 MB of the 4 MB back.

This makes sense when you consider that by opening the stack and then
reading the field into a variable, I actually ended up with the same info in
RAM twice... once in the variable and once in the open stack.

The moral of the story - if you have to read data, read it from a file if
possible.  It will happen faster (no stack to open), and take less RAM.  AND
you get more RAM back when you dump the contents of the variable.  Just what
I needed!

:)
Richard MacLemale
coolclassroom.com

Reply via email to