[Seaside] Re: FAQ suggestion: Memory shrinking

Yanni Chiu yanni at rogers.com
Thu Sep 1 04:15:45 CEST 2005


Dmitry Dorofeev wrote:
> 
> But i have no idea what is
> -Nuke the Halo class var in WAHalo
> -nil out all inst vars of all instances of "WASession allSubclasses"

My image often grew to about 60MB (which caused
a save image to be slow on my system). So I had
to track down what was holding onto the objects,
by following the object references (using the
method described by others).

Doing:
  WARegistry clearAllHandlers
  Smalltalk garbageCollect
should have cleaned up everything (maybe).

I eventually found that WAHalo had a class variable
called Halo, which cached some things. If you reset
the value to nil, then it will empty the cache.
This step recovered only some memory, not the
"motherlode" I first thought it would be.

Further following the object references led to
instances of ZZZSession (where ZZZSession are
subclasses of WASession from my code). After setting
all the instance variables to nil, I recovered
about 35MB. I use something like:

  WASession allSubclasses do: [:c | c allInstances do: [:e | e dbConnection: nil]]



More information about the Seaside mailing list