MajorShrink & SystemTracer

Dan Ingalls Dan.Ingalls at disney.com
Wed Jan 5 16:04:13 UTC 2000


>  Probably someone else will give us much more better
>explanations:-)
>
>>     Could you tell me which classes are the "obsolete"
>> classes? (I did not know that term).
>
>  There is (should be) no obsolete class in the vanilla
>image.  But every class about to be removed from system is
>once marked as "obsolete".  Usually, the class object is
>unreachable from anywhere and reclaimed by the garbage
>collector sometime later.
>
>  However, sometimes the "removed" class object is still
>reachable from somewhere (existing instances, method
>literals, etc.) and remains in the image.  Such class is
>called obsolete class.
>
>  See the implementors and senders of #obsolete.
>
>  Though I'm not 100% confident it is the problem (sorry),
>but I guess it has a relation to the problem.

Yoshiki explained this pretty well.  I can add a few more thoughts...

Tracking down obsolete instances and classes is one of the hardest problems in Squeak.  I just went through this for the 2.7 release.  I can tell you several things:

First 2.7 as released will be entirely free of obsolete classes, so it should serve as a good base for your desire to run the system tracer.

Second, the way I track them down is to start by inspecting the result of Smalltalk obsoleteClasses.  then I pick one and examine 'all objects pointing to' it.  And so on until I get some illumination about what is going on (and this is hard because the inspectors are pointing also).

In the case of 2.7 alpha, there were two main causes.  One was in PlayWithMe6, in which the Fabrik-built browser was looking at a class that had been mutated because its superclass had changed.  All that was required was to deselect and reselect in that browser -- poof several obsolete classes went away.  The other main problem had to do with the Wonderland in PWM7.  It should have been possible to simply say 'reset' and gotten everything cleaned up, but that doesn not work for various reasons.  I wound up pawing through the wonderland structure, and replacing one array of obsolete classes with their non-obsolete counterparts, and manually resetting the undoStack, which released a context that was holding onto two more obsolete classes.

It's often pooosible to simply delete things and get rid of the obsolete classes -- I oculd have just deleted PWM6 and PWM7 in this case.  Also, when writing a clone with the system tracer, it it usually possible to write a nil in place of any instance of an obsolete class.  Typically that thing will then fail when you run it, but you can usually delete it on the other side of the clone. 

Hope this helps

	- Dan

"May your system never have obsolete classes"






More information about the Squeak-dev mailing list