[squeak-dev] growing image and WeakIdentityKeyDictionary
martinkuball at web.de
Thu Jul 16 20:09:42 UTC 2009
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
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
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?
More information about the Squeak-dev