[comp.sys.mac.hypercard] Memory Problem

jstern@garnet.berkeley.edu (04/13/91)

We're having memory problems.  ("Not enough memory to use painting 
tools.")  Our systems have 2.5 M (and have no inits but Disinfectant)  
so I'm not willing to just accept the fact that we need more  memory.  
I can think of several things that I'm doing that could be contributing 
to the problem, but would appreciate any guidance on what might be 
the most fruitful attack to take.  (There doesn't seem to be a whole 
lot out there, published,  on memory problems when using HyperCard.)

Here's what I see as potential problems:

1) Lots of stacks "in use" (6 currently). 
Our basic setup is this: 12 machines (SEs & Pluses); each machine has 
a stack that the students use, and add to throughout the semester. A 
large percentage of the handlers for those stacks,however,  reside in 
the 6 stacks in use. These 6 stacks reside on our  network server (in a 
folder that's read only for the students).  I need to do it this way so 
that I can quickly and easily make changes to the handlers 
(i.e. sometimes between class periods).   
For simplicity's sake I "start using" all 6 stacks when the stack on 
the local machine is first opened.  I know that I probably should start 
using stacks only when I need the handlers in each, and then stop using 
each when I can, but it'll take me days to figure out which handlers get 
called when, and then to do the appropriate moving around of handlers 
amongst the 6 stacks.
Is it worth it for me to take the time to do this?  I guess I question 
if this is the biggest part of the problem because we don't run out 
of memory when using the painting tools early in a session; it's  
only after doing a bunch of stuff and then trying to use the painting 
tools that we get the "Not enough memory to use painting tools"
 message.

2) XCMDS--again lots.  Some of these have been written by graduate 
students specifically for this application.  Could it be simply (ha!) 
that some xcmd somewhere isn't de-allocating some specific block of 
memory that the painting tools really want? Is there any way to figure 
out what specifically Hypercard wants that it can't get? At one point I 
was checking the heapspace each time before asking for the painting 
tools, and didn't find any difference between the situation where it 
wouldn't let me use the painting tools, and the situation where it 
would, so it seems like it's not just a matter of finding enough 
contiguous space in memory.  (But then again, I don't know a whole lot 
about memory allocation, obviously.)  Should I take the time to test 
each xcmd/xfcn, and then combos, to try to determine which one might be 
causing the problem?

3) Globals -- probably too many of these as well (I think somewhere 
around 40); many of them hold information from the server that's 
referred to throughout the stack (nothing huge), but some of them 
probably could be emptied.  I doubt that this is the problem, but if 
someone tells me otherwise, I'll get working on this right away.


I realize I'm being pretty vague, and if anyone thinks they can help 
with more specific info (e.g. precise figures for heapspace; which xcmds 
I use, etc.) , I'll be glad to provide it.  Other than that, can anyone 
provide general wisdom, enough to let me know which of the above things 
(or something completely different) that I should try first? 

Thanks for any advice,
Judy Stern
Instructional Technology Program
UCBerkeley
jstern@garnet.berkeley.edu