Unwanted instances in the 3.2 image
Norton, Chris
chrisn at Kronos.com
Fri Jul 19 18:48:19 UTC 2002
Richard O'Keefe pointed out that there are many instances of the Preferences
class hanging around in the 3.2 distribution image. I thought it might be
nice to see what other instances were hanging around in my image, so I wrote
a little script to find out what's in there. Mayhap this can help you
sanitize your images. :-)
I imagine that a similar script to find memory hogs would also be useful
(i.e. find the sizes of the various instances to see which instances are
taking up all of your memory).
Cheers,
---==> Chris
"Find all classes that have 100 or more instances..."
| aClass granularity numInstances |
granularity _ 99.
Smalltalk keys asSortedCollection do: [:each |
aClass _ Smalltalk at: each.
(aClass isKindOf: Class)
ifTrue: [
((numInstances _ aClass allInstances size) >
granularity)
ifTrue: [
Transcript
show: aClass printString;
show: ' ';
show: numInstances
printString;
cr ]]].
More information about the Squeak-dev
mailing list
|