A Better (different) WeakArray

William Harford seaside at harford.org
Fri Feb 10 15:16:02 UTC 2006


Hi All,

I am building a persistent Object to Relational storage engine and am  
using WeakValueDictionary for an object cache. This works great for a  
small number of object (< 1000) but if the cache gets more than a  
couple thousand objects the WeakArray finalization process begins to  
take over and grind the image to a halt.

I am interested to know why WeakArray finalization eats up the CPU  
when standard gc does not. The only gc methods I have implemented  
have been standard reference counting ones so I know little of the  
details of other garbage collectors.

My second question is.....
Is there a simple way to implement a WeakArray (WeakValueDictionary)  
that handles larger value set better. Maybe a WeakValueDictionary  
that only ever looks at 1000 elements at a time for finalization and  
would run less often.

Any ideas, explanation, or input would be appreciated.
Thanks
Will





More information about the Squeak-dev mailing list