[Pharo-project] Another fixes to finalization (was Re: [update 1.2] #12161 - #12172)

Levente Uzonyi leves at elte.hu
Fri Oct 1 13:05:47 EDT 2010


On Fri, 1 Oct 2010, Igor Stasenko wrote:

> I uploaded new changesets to
> http://code.google.com/p/pharo/issues/detail?id=3002
>
>
> I tested applying them in Pharo-Core-#12159
> and then updating an image after that.
>
> After update:
> MCMethodDefinition cachedDefinitions size is 18668
>
> But image don't feels slow.
>
> As a side note, i recommend to review the MC caching mechanism towards
> avoiding putting so much load
> on finalization process (such as scanning 18k entries to find dead objects).
>
> This is actually the purpose of new finalization scheme:
> - it allows to avoid scanning whole weak dictionary in order to get
> rid of expired associations.

WeakKeyDictionaries shouldn't be added to the finalization process at all. 
In the current case there's no finalization action at all, so it's 
totally pointless IMO. And these dictionaries are not thread-safe, so bad 
things can happen if they are registered with the finalization process.

>
> I'm already implemented a variant of self-cleaning weak dictionary for Magma,
> which using new finalization scheme, and avoids scanning huge number
> of entries to discover few of them,
> which became garbage.

Squeak's WeakKeyDictionaries are self cleaning, though the there's no 
guarantee that finalization action is performed when the key is GC'd.


Levente

>
>
> -- 
> Best regards,
> Igor Stasenko AKA sig.
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>




More information about the Pharo-dev mailing list