Chris Muller wrote:
I'm placed a line in removeGarbageCollectedObjectEntries Transcript show: 'Oids count: ' , self oidCount asString; cr. And during running Florian's update it shows (between other lines): Oids count: 29923 Oids count: 45449 Oids count: 49919 Oids count: 66399 Oids count: 76492 So its growing and growing.. And only way to get rid of dead keys, is to call MaOidManager>>finalizeOids. But i can't find any places, leading to call of this method. Is this designed to be managed by user directly, using MagmaSession>>finalizeOids ?
Yes, as documented in the performance tuning page
http://wiki.squeak.org/squeak/2985
at this time finalizeOids is intended to be called by the user,
I make a call to finalizeOids after every commit in my application but it must not be enough.
I think it should call finalizeValues to dicts in removeGarbageCollectedObjectEntries, so both dicts with object>id and id>object associations will be cleaned and rehashed.
but that sounds like a good idea. I know these two cleaning mechanisms were tacked on years apart from each other, so maybe that's why they ended up separate mechanisms.
Of course, all this is just to accomodate less than ideal Weak Dictionary's included with Squeak. I'd much rather fix or replace the Dictionary's. Florian, have you tried any alternative Weak Dictionary's available? Be sure to check out Martin Loewis' and Sig's. (I've posted the link to Martin's several times in the last months, it's on Mantis).
I tried sig's optimisation and it was a lot quicker than the normal one. The problem was the race condition we are dealing with arrived quicker too. A simple but bad solution was to add a delay in #reject:. I don't know if sig has got a better solution yet.
I'll try the Martin Loewis's optimisation to compare the two.
Florian