[Pkg] The Trunk: System-eem.793.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Feb 2 19:48:54 UTC 2016


Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.793.mcz

==================== Summary ====================

Name: System-eem.793
Author: eem
Time: 2 February 2016, 11:48:18.26222 am
UUID: 5d65cf5d-0564-4825-90d0-569661e6ae3e
Ancestors: System-dtl.792

Implement a reasonable lowSpaceLimit for the Stack and Cog VMs.  David, this /should/ be back-ported to 4.6.

=============== Diff against System-dtl.792 ===============

Item was changed:
  ----- Method: SmalltalkImage>>lowSpaceThreshold (in category 'memory space') -----
  lowSpaceThreshold 
+ 	"Answer the low space threshold. When the amount of free memory (after garbage collection)
+ 	 falls below this limit, the system is in serious danger of completely exhausting memory and
+ 	 crashing. This limit should be made high enough to allow the user open a debugger to diagnose
+ 	 a problem or to save the image.  In a stack-based VM such as Cog contexts for activations in
+ 	 the stack zone will have to be created as the debugger opens, requiring additional headroom."
- 	"Return the low space threshold. When the amount of free memory (after garbage collection) falls below this limit, the system is in serious danger of completely exhausting memory and crashing. This limit should be made high enough to allow the user open a debugger to diagnose a problem or to save the image."
  
+ 	| slotsForDebugger slotsForContextsOnStackPages |
+ 	slotsForDebugger := 65536. "Arbitrary guess"
+ 	slotsForContextsOnStackPages :=
+ 		(self vmParameterAt: 42)
+ 			ifNil: [0]
+ 			ifNotNil:
+ 				[:numStackPages| | headerSize numActivationsPerPage maxContextSize |
+ 				numActivationsPerPage := 40. "Design goal of the Cog VM"
+ 				headerSize := 2. "64-bytes for Spur"
+ 				maxContextSize := MethodContext instSize + CompiledMethod fullFrameSize + headerSize.
+ 				numStackPages * numActivationsPerPage * maxContextSize].
+ 	^slotsForDebugger + slotsForContextsOnStackPages * self wordSize!
- 	thisContext isPseudoContext
- 		ifTrue: [^ 400000  "Enough for JIT compiler"]
- 		ifFalse: [^ 200000  "Enough for interpreter"]!



More information about the Packages mailing list