Some camparisons between squeak versions.

Dan Ingalls Dan at SqueakLand.org
Tue Sep 12 04:50:44 UTC 2006


Hi guys (especially Peace Jerome) -

I'm very late to see this message, but it looks like it never got fully answered.  If you care about truly exact instance counts, you must be very careful, especially about, eg, MethodContexts (which if everything is running right are being created by the millions every second).

Being "very careful" here means doing a garbageCollect before you start, and possibly doing more garbageCollects ( or garbageCollectMost) during the process if you are going through a number of classes as, for instance, allSubinstances does.  instanceCount and allinstances were carefully written so as not to allocate any contexts while they run, but more elaborate tallies may well allocate some objects that are not reclaimed until the next collection.  Actually the only one causing real confusion here is MethodContext, and for that, I believe you will find that printing the result of
	'Smalltalk garbageCollect.  MethodContext instanceCount'
should give you results that are close to the number of contexts in the basic image, and that are reasonably comparable from one image to the next.  In 3.8, I get 119, and in 3.9, I get 115(*), but note that frequently the results are a bit higher, presumably because of processes that run at a higher priority during the enumeration.  You could have fun running this at the highest priority to check, but you probably know things that are even more fun to do.

Hope this helps

	- Dan

(*) If you're wondering what these hundred or so contexts are about, looking at the suspended processes in the ProcessBrowser should be illuminating.

>The gatherer:
>
>{CompiledMethod . MethodDictionary . MethodContext .
>Class  }
>collect:
>[ :class |
> class printString
>, ' '
>, class allSubInstances size printString
>, String cr ]
>
>And the results:
>
>Sq7054
> #('CompiledMethod 44834
>' 'MethodDictionary 4108
>' 'MethodContext 4170
>' 'Class 2037
>')
>
>sq6665 (3.8)
> #('CompiledMethod 47792
>' 'MethodDictionary 3612
>' 'MethodContext 1352
>' 'Class 1668
>')
>
>Sq5976 (3.7)
>#('CompiledMethod 41206
>' 'MethodDictionary 3140
>' 'MethodContext 874
>' 'Class 1546
>')
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com




More information about the Squeak-dev mailing list