Memory question, old MC versions

valetia at mac.com valetia at mac.com
Tue Apr 8 21:51:00 EDT 2003


Hi Karl,

> From: Karl Becker <karl at karlbecker.com>
> Date: Tue, 8 Apr 2003 17:45:54 -0500
> 
> I made a word processor quite awhile ago using New Tricks and it uses
> 15,000K of RAM on a 68K machine.  I have one idea why its using a lot
> of memory - it reads the stack name property of every stack in a
> directory, and it's probably loading about 5 to 8 stacks just to read
> the title of the stack.  It doesn't actually toplevel any of those
> stacks, but it must have to load them if it's reading their stack names
> (not their file name, but actual stack name).

I'm assuming the stack names have to change from time to time, which is the
reason you need to read them from the actual stacks rather than have the
names hard-coded or stored permanently somewhere.

Why not combine the best of both worlds: have a separate tiny "reference"
stack store the names of the stacks (perhaps in a field or custom property).

Whenever you need to change the name of a stack, also update the
corresponding record in the reference stack.

Then each time your app needs to refer to the stack names, you'd just be
loading the reference stack.

Not only would this take up less memory (assuming that's what's causing the
issue), it would likely be quicker as well.

Hope this helps somewhat.

Valetia





More information about the metacard mailing list