[Seaside] Re: Why isn't this a weak dictionary of some ilk?

Andreas Raab andreas.raab at gmx.de
Thu Apr 23 02:31:06 UTC 2009

Lukas Renggli wrote:
>> Lukas, all these topics is about a weak array finalization process,
>> which is just made for a convenience and on top of  the fact, that VM
>> supports weak references.
> I understand that. And I remember that the suggestion was to implement
> our own finalization code. The reasons why we didn't do so were the
> following:

The reasoning makes sense to me. I have one question though: Do you 
actually require finalization or is this "just" for caching? If the 
latter, I think there is a good chance of devising an alternative 
solution that clears out weak dicts as you go, only touching  the slots 
that you would touch in a normal insertion/removal process. This could 
solve the caching problems but it wouldn't work if you expect this to 
work for finalization since even a full GC wouldn't necessarily cause 
the entries to be cleared if they aren't touched otherwise. Would this 
be a useful tradeoff for your usage patterns or completely pointless?

   - Andreas

> - It was pretty easy to get rid of the requirement for weak data
> structures. The wasted memory was not significant enough to make it
> worth worrying about a special solution.
> - Introducing custom finalization code is highly non-portable across.
> At the time of Seaside 2.7 and 2.8, there were no easy possibilities
> to factor such code out.
> - Last but not least, I might be wrong on this, we had the impression
> that this was a Squeak only problem. I've never heard of similar
> problems with other Smalltalk. The finalization of session state just
> works out of the box.
> Maybe the real root of the problem is not even the weak finalization,
> but the way Squeak handles and rehashes large Dictionaries?
> Lukas

More information about the seaside mailing list