Eliot Miranda uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-eem.955.mcz
==================== Summary ====================
Name: System-eem.955 Author: eem Time: 27 June 2017, 6:07:12.882121 pm UUID: da5503a6-f9c7-4332-8cce-2ac9dfd50b43 Ancestors: System-eem.954
Have bytesLeft answer the result it claims to (Spur changed the p[rmitive to answer the largest free chunk; needed for the allocation failure followed by growth and retry logic). Update bytesLeft string to include the largest free chunk info. Comment garbageCollect properly. Fix a comment typo. Nuke unused methods in SuystemDictionary that are in SmalltalkImage.
=============== Diff against System-eem.954 ===============
Item was changed: ----- Method: SmalltalkImage>>bytesLeft (in category 'memory space') ----- bytesLeft "Answer the number of bytes of space available. Does a full garbage collection."
+ self garbageCollect. + ^self bytesLeft: true! - ^ self garbageCollect - !
Item was changed: ----- Method: SmalltalkImage>>bytesLeft: (in category 'memory space') ----- bytesLeft: aBool + "Return the amount of available space. If aBool is true, include possibly available swap space. + If aBool is false, include possibly available physical memory. For a report on the largest free + block currently available within Squeak memory but not counting extra memory use #primBytesLeft." - "Return the amount of available space. If aBool is true, include possibly available swap space. If aBool is false, include possibly available physical memory. For a report on the largest free block currently availabe within Squeak memory but not counting extra memory use #primBytesLeft." <primitive: 112> ^self primBytesLeft!
Item was changed: ----- Method: SmalltalkImage>>bytesLeftString (in category 'memory space') ----- bytesLeftString + "Answer a string describing the amount of memory available." + "Smalltalk bytesLeftString" + | largestFree availInternal availPhysical availTotal | + largestFree := self garbageCollect. - "Return a string describing the amount of memory available" - | availInternal availPhysical availTotal | - self garbageCollect. availInternal := self primBytesLeft. availPhysical := self bytesLeft: false. availTotal := self bytesLeft: true. (availTotal > (availInternal + 10000)) "compensate for mini allocations inbetween" ifFalse:[^availInternal asStringWithCommas, ' bytes available']. + ^String streamContents: + [:s| + {availInternal. availPhysical. largestFree. availTotal} + with: #('old space' 'physical' 'largest free chunk' 'total') + do: [:value :name| + s nextPutAll: value asStringWithCommas; nextPutAll: ' bytes ('; nextPutAll: name; nextPutAll: ') '; cr]]! - ^String streamContents:[:s| - s nextPutAll: availInternal asStringWithCommas, ' bytes (internal) '; cr. - s nextPutAll: availPhysical asStringWithCommas, ' bytes (physical) '; cr. - s nextPutAll: availTotal asStringWithCommas, ' bytes (total) '].!
Item was changed: ----- Method: SmalltalkImage>>garbageCollect (in category 'memory space') ----- garbageCollect + "Reclaims all garbage and answers the number of bytes of available space in the largest free chunk." - "Primitive. Reclaims all garbage and answers the number of bytes of available space." Object flushDependents. EventManager flushEvents. ^self primitiveGarbageCollect!
Item was removed: - ----- Method: SystemDictionary>>growMemoryByAtLeast: (in category 'memory space') ----- - growMemoryByAtLeast: numBytes - "Grow memory by at least the requested number of bytes. - Primitive. Fail if no memory is available. Essential. - N.B. In Spur, the heap is composed of segments. Growing memory adds a new - segment; it does not extend existing segments. Growth is by at least that - established by SmalltalkImage current vmParameterAt: 25, which defaults to 16Mb." - <primitive: 180> - ^(numBytes isInteger and: [numBytes > 0]) - ifTrue: [OutOfMemory signal] - ifFalse: [self primitiveFailed]!
Item was removed: - ----- Method: SystemDictionary>>maxIdentityHash (in category 'system attributes') ----- - maxIdentityHash - "Answer the maximum identityHash value supported by the VM." - <primitive: 176> - ^self primitiveFailed!
Item was removed: - ----- Method: SystemDictionary>>setGCParameters (in category 'snapshot and quit') ----- - setGCParameters - "Adjust the VM's default GC parameters to avoid too much tenuring. - Maybe this should be left to the VM?" - - | proportion edenSize survivorSize averageObjectSize numObjects | - proportion := 0.9. "tenure when 90% of pastSpace is full" - edenSize := SmalltalkImage current vmParameterAt: 44. - survivorSize := edenSize / 5.0. "David's paper uses 140Kb eden + 2 x 28kb survivor spaces; Spur uses the same ratios :-)" - averageObjectSize := 8 * self wordSize. "a good approximation" - numObjects := (proportion * survivorSize / averageObjectSize) rounded. - SmalltalkImage current vmParameterAt: 6 put: numObjects "tenure when more than this many objects survive the GC"!
packages@lists.squeakfoundation.org