Finalization (was: Re: [Seaside] WeakArray (again))

Jon Hylands jon at huv.com
Sat Mar 25 12:59:05 UTC 2006


On Fri, 24 Mar 2006 19:23:12 -0800, Andreas Raab <andreas.raab at gmx.de>
wrote:

> And once you do 
> that you need to deal with the ugly corner cases of an overflow of the 
> finalization queue (and the effect that you probably can't allocate any 
> larger one because the GC you're currently in was triggered by a low 
> space condition to begin with ;-) Nasty, nasty issues.

I ran into this recently with VisualAge, and its probably the nastiest bug
of my career. I still haven't completely fixed it. The context of the bug
is entries in an identity map (cache) are getting finalized, and if there
are too many at once, it overflows the queue, so only some of the objects
in the isolated subgraph are getting finalized. If, before the finalization
starts up again, someone makes a hard reference to one of the objects in
the subgraph that was slated for finalization but didn't (because the weak
ref in the cache is still there), we end up with the whole GC of the
subgraph getting cancelled, and thus objects now referenced within the
subgraph that are no longer in the cache.

Very nasty, almost impossible to identity without totally screwing
performance, and the only real way to recover is to just dump the whole
cache.

Later,
Jon
--------------------------------------------------------------
   Jon Hylands      Jon at huv.com      http://www.huv.com/jon

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
           http://www.huv.com



More information about the Squeak-dev mailing list