Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!newsfeed.rice.edu!nb.rockwell.com!uunet!in2.uu.net!hodes.com!netcomsv!uucp3.netcom.com!slcgate!servio!servio!aland
From: aland@servio.slc.com (Alan Darlington)
Subject: Re: VW2.0 - How to prevent image blowup ?
Message-ID: <1995Aug7.221330.7323@slc.com>
Sender: news@slc.com (USENET News)
Nntp-Posting-Host: servio
Organization: GemStone Systems, Inc., Beaverton OR, USA
References: <DCIsF5.L0v@discus.technion.ac.il>
Date: Mon, 7 Aug 1995 22:13:30 GMT
Lines: 35

zviki@techunix.technion.ac.il (Cohen Zviki) writes:
> 	Hello ! 
> 
> 	I'm currently working of a very UI intensive application in VW2.0. 
> The problem is that my image keeps on growing. I started with the basic 4.5
> Megs image and each day I've added about half a meg. I'm now at around 7.7 
> and it is growing rapidly. I tried garbage collecting before saving, closing
> windows, etc., but nothing seems to work. The fact is that my code is not so
> big (around 40Ks when filed out), so there's no reason for the large image.
> 
> 			TIA,
> 					Zviki Cohen

I would first check for dependents.  Temporary objects (especially in the
UI area) often register themselves as dependents of other more permanent
objects.  If they don't get removed from these dependent lists properly,
they will never get garbage collected.

Pick a class (either yours or a UI class) that (1) you know should have
few or no instances (i.e. no UI windows or window builders open) and (2)
could take up a lot of space.  Inspect #allInstances of this class.  If
there are more instances than you expected, start tracking down the
#references to each instance.  (You will quickly wind up with lots of
inspectors.)  Your objective is to find a permanent object (such as a
global or class variable) that is holding on to these objects when it
should not be.  Fix the problem.  Repeat until your image is back to its
normal size, or until you run out of patience.  :-)

Be warned - this is tedious and time-consuming.  You might well want to
write some code to automate this process.  (This is an area where some
3rd-party tools could really be useful.  Does anyone know of any?)

  Hope this helps!
  Alan
  (standard disclaimer)
