[squeak-dev] growing image and WeakIdentityKeyDictionary

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] growing image and WeakIdentityKeyDictionary

Martin Kuball
Hi!

My development image has grown over the last 2 years from about 20 MB to
almost 60 MB now. I finally got around to examine the cause of this
growth.

I did a SpaceTally on the image. ByteString, Array and Bitmap together
consume about 35% of the memory with thousands of instances. Not a good
starting point to dig deeper.

Much more unusual seemed to be th 310957 instances of Point, the 22373
instances of EventHandler, the 6554 instances of Browser and finally the
10 WhiskerWindow instances.

WhiskerWindow is where I started with. I got hold of the instances and
followed their pointers to the root. All except the last one (beeing the
one opened) led to the class variable ActionMaps in EventManager. That map
holds currently 8917 entrys. Not surprisingly most of them are Browser
instances.

Now the big question is, how can I get rid of them. Shouldn't they be
garbage collected at some point because the keys are weakly held on? And
how can I prevent it from happening again?

Martin