[squeak-dev] Re: 100 Million objects

John M McIntosh johnmci at smalltalkconsulting.com
Thu Feb 28 21:57:09 UTC 2008


On Feb 28, 2008, at 1:31 PM, Andreas Raab wrote:
>  "These settings describe what to do when we're close to running out  
> of free space"
>
>  "Tell the VM that we'd rather grow than spinning in tight GC loops"
>  Smalltalk gcBiasToGrow: true. "default: false"
>  "Tell the VM to do a fullGC for good measure if the above growth  
> exceeded 16MB"
>  Smalltalk gcBiasToGrowLimit: 16*1024*1024. "default: 0"
>
> Cheers,
>  - Andreas


Further to this in Sophie we have a SophieMemoryPolicy which does  
passive checking for certain things and
perhaps changes things on the fly

The real issue is when the root table points to many arrays and we  
have to scan each Array looking for
the young object, that leads to excessive work in the IGC.

But I know that cases arises when we see 	(statMarkCount ) >  
(statAllocationCount*2) so we force a tenure which fixes the problem.

I experimented with setting goals for the new space object allocation,  
and tenuring threshold. This works
ok if you have a particular ms wait for a IGC in mind and perhaps a  
server type of load, if you have a server
test suite that mimics your workload then fiddling with Smalltalk  
vmParameterAt: 5/6 on the fly might alter
things (good/bad).


calculateGoals
| target |

	vmNotSupported = true ifTrue: [^self].

	(statMarkCount ) > (statAllocationCount*2)
		ifTrue: [[Smalltalk forceTenure] on: Error do: [:ex | ]].  "Tenure  
if we think too much root table marking is going on"

	true ifTrue: [^self].

	" Logic below is not used, still there in case one wants to try it "
	"Unused logic to set allocation and tenure limits to reach some sort  
of icremental GC ms time"

	(statIGCDeltaTime = 0) ifTrue:
		[target _ (Smalltalk vmParameterAt: 5)+21.
		Smalltalk vmParameterAt: 5 put: target.  "do an incremental GC after  
this many allocations"
		Smalltalk vmParameterAt: 6 put: target*3//4.  "tenure when more than  
this many objects survive the GC"].
	(statIGCDeltaTime > 0) ifTrue:
		[target _ ((Smalltalk vmParameterAt: 5)-27) max: 2000.
		Smalltalk vmParameterAt: 5 put: target.  "do an incremental GC after  
this many allocations"
		Smalltalk vmParameterAt: 6 put: target*3//4.  "tenure when more than  
this many objects survive the GC"].

	
	(statIGCDeltaTime < 1) ifTrue:
		[target _ (Smalltalk vmParameterAt: 5)+21.
		Smalltalk vmParameterAt: 5 put: target.  "do an incremental GC after  
this many allocations"
		Smalltalk vmParameterAt: 6 put: target*3//4.  "tenure when more than  
this many objects survive the GC"].
	(statIGCDeltaTime > 1) ifTrue:
		[target _ ((Smalltalk vmParameterAt: 5)-27) max: 4000.
		Smalltalk vmParameterAt: 5 put: target.  "do an incremental GC after  
this many allocations"
		Smalltalk vmParameterAt: 6 put: target*3//4.  "tenure when more than  
this many objects survive the GC"].


--
= 
= 
= 
========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= 
= 
= 
========================================================================





More information about the Squeak-dev mailing list