[squeak-dev] Finalization enhancement for 4.2

Levente Uzonyi leves at elte.hu
Thu May 20 16:15:55 UTC 2010


On Thu, 20 May 2010, Chris Muller wrote:

> I have packaged up Igor's change-sets for the finalization fix:
>
>  http://bugs.squeak.org/view.php?id=7525
>  http://bugs.squeak.org/view.php?id=7473
>
> into their respective MC packages and uploaded them to the Inbox.
>
> Recall the original discussion:
>
>  http://lists.squeakfoundation.org/pipermail/vm-dev/2010-March/003958.html
>
> I have been running with Igor's enhanced VM and image-side
> finalization patches for a few weeks now.  The results are striking.
> Squeak applications using large Weak-collections deteriorate to a
> point of unusability without this fix because Squeak spends 95% of its
> time in the finalization process, leaving no time for application
> processing. With this fix installed, CPU utilization is 0% when the
> application is idle, providing excellent responsiveness.

A few notes:
- since 4.1 only WeakRegistries have to be registered to the finalization 
process. Weak dictionaries with a custom finalizers can also benefit 
from registration, but they should work without it. The custom finalizers 
were also introduced in 4.1, so most weak collections are not affected in 
4.1.
- WeakFinalizationRegistry lacks synchronization, so you have to be 
careful when you try to replace the use of WeakRegistry with 
WeakFinalizationRegistry. (this was also discussed in the above thread)

>
> This is a big, big, win for any application that uses Weak
> collections, and a win for Squeak overall because it's own use of
> weak-collections is enhanced.

See above.

>
> While it seems to be backward compatible, e.g. I am able to run the
> enhanced VM on older images (including 3.9), and I am able to run with
> these image changes on an older VM, both are required to take
> advantage of the enhanced finalization.

See above.


Levente

>
> I would like to push this into the trunk, but will need help from the
> VMMaker developers for that piece.  David?
>
> For Magma, this wil be the most exciting and important fix since
> #becomeForward:copyHash: introduced back in 2004.
>
> - Chris
>
>



More information about the Squeak-dev mailing list