|
From: John M M. <jo...@ma...> - 2005-02-01 02:04:26
|
On Jan 28, 2005, at 2:55 PM, Andreas Raab wrote: > Hi John, > >> Ok, I consolidated all of this, added a prim to turn the biasGrowth >> behavior on where the grow and post fullGC logic is in the interp.c >> code, versus being partially in the image. Also a prim to set the >> threshold for doing the fullGC if we have grown by N bytes. Thus you >> can turn off/on and set the boundary. Left in the other prims as >> agreed. > > Thanks, this sounds good. > >> a) The 10 entries I have for FinalizationDependents have sizes of #(0 >> 2 0 3 2 55825 nil nil nil nil). You will note the one with 55,825 >> entries. This actually a 98K or so WeakIdenityKeyDictionary of >> CompiledMethods. > > This is not the case in any image I am using. You must be using a > non-standard image; all the regular ones that I've checked have #(0 2 > nil nil nil nil nil nil nil nil) (0: Sockets; 2: Files). Well no it's not a non-standard image, rather it's a working image floating about that I have VMMaker in, but the problem is I filed in your code from your note of Nov 11th/ 2004 (below) when you were talking about issues with the finalization process and CPU performance. Seems I filed this in and save the image (duh! well that was dumb). For some reason the macrobenchmark triggers a weak object GC event base on the new changes which then grinds thru the 48K WeakIdentityKeyDictionary and as you point out that's CPU intensive. Smalltalk removeKey: #CPUHog of course fixes things. > I've seen this problem myself. It is easiest to see what happens when > you have a process browser open and turn on the cpu watcher - this > will show that the finalization process takes a huge amount of > resources. > > But why? Most likely (this was the case I have experienced) you have > created some weak collection with what I consider "automatic > finalization", e.g., WeakRegistry and friends register themselves to > get notified when a weak references got freed. If this registry grows > very large it can take significant amounts of time to do the > finalization and if your code is then weak reference heavy you may > spend a lot of time in finalization. > > Here is an example illustration the problem: > | hog proc | > hog := WeakIdentityKeyDictionary new. > CompiledMethod allInstancesDo:[:cm| hog at: cm put: 42.0]. > Smalltalk at: #CPUHog put: hog. > WeakArray addWeakDependent: hog. > -- ======================================================================== === John M. McIntosh <jo...@sm...> 1-800-477-2659 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ======================================================================== === |