# HG changeset patch # User Claus Gittinger # Date 819296588 -3600 # Node ID c118ce1f8afdfdefbb53a1967baf613440087c80 # Parent 8731287abedd6ccc954936350453e3df2e5ac8d0 flush in subprocess diff -r 8731287abedd -r c118ce1f8afd MemMonitor.st --- a/MemMonitor.st Sun Dec 17 15:47:14 1995 +0100 +++ b/MemMonitor.st Mon Dec 18 15:23:08 1995 +0100 @@ -10,15 +10,13 @@ hereby transferred. " -'From Smalltalk/X, Version:2.10.5 on 22-mar-1995 at 7:43:35 am'! - StandardSystemView subclass:#MemoryMonitor - instanceVariableNames:'updateInterval updateBlock myProcess oldData newData freeData + instanceVariableNames:'updateInterval updateBlock myProcess oldData newData freeData updateIndex org maxTotal minTotal dX newColor freeColor oldColor prevTotal prevFree prevFree2 prevOld scale' - classVariableNames:'' - poolDictionaries:'' - category:'Interface-Tools' + classVariableNames:'' + poolDictionaries:'' + category:'Interface-Tools' ! !MemoryMonitor class methodsFor:'documentation'! @@ -37,10 +35,6 @@ " ! -version - ^ '$Header: /cvs/stx/stx/libtool/Attic/MemMonitor.st,v 1.28 1995-12-15 12:13:22 cg Exp $' -! - documentation " Shows memory usage (oldspace + newspace). Simple, but useful. @@ -96,99 +90,38 @@ ^ (200 @ 280) ! -defaultLabel - ^ 'Memory Monitor' -! - defaultIcon |i| i := Image fromFile:'MemMonitor.xbm'. i notNil ifTrue:[^ i]. ^ super defaultIcon +! + +defaultLabel + ^ 'Memory Monitor' +! ! + +!MemoryMonitor methodsFor:'destroying'! + +destroy + updateBlock notNil ifTrue:[ + Processor removeTimedBlock:updateBlock. + ] ifFalse:[ + myProcess terminate. + myProcess := nil + ]. + oldData := newData := freeData := nil. + super destroy ! ! !MemoryMonitor methodsFor:'drawing'! -updateDisplay - "update picture; trigger next update" - - |total oldSpaceUsed newSpaceUsed freeMem oldSpaceSize - gWidth shift scaleChange margin mustWait| - - shown ifTrue:[ - oldSpaceUsed := ObjectMemory oldSpaceUsed + ObjectMemory symSpaceUsed. - newSpaceUsed := ObjectMemory newSpaceUsed. - freeMem := ObjectMemory freeListSpace + (ObjectMemory oldSpaceSize - ObjectMemory oldSpaceUsed). - oldSpaceSize := ObjectMemory oldSpaceSize + ObjectMemory symSpaceSize. - total := oldSpaceSize + ObjectMemory newSpaceSize. - - scaleChange := false. - - ((total - freeMem) < minTotal) ifTrue:[ - minTotal := total - freeMem. - scaleChange := true - ]. - (total > maxTotal) ifTrue:[ - maxTotal := total. - scaleChange := true - ]. - - oldData at:updateIndex put:oldSpaceSize. "/ oldSpaceUsed. - newData at:updateIndex put:newSpaceUsed. - freeData at:updateIndex put:freeMem. - updateIndex := updateIndex + 1. - - scaleChange ifTrue:[ - scale := height asFloat / (maxTotal + 100000). - self redraw - ]. - - gWidth := width - org. - margin := 1. +redraw + "redraw all" - mustWait := false. - ((updateIndex-1) >= (gWidth - margin)) ifTrue:[ -"on slow displays, use:" -"/ shift := gWidth // 4. - -"for smooth display, use:" - shift := 1. - - oldData replaceFrom:1 with:oldData startingAt:shift+1. - newData replaceFrom:1 with:newData startingAt:shift+1. - freeData replaceFrom:1 with:freeData startingAt:shift+1. - - updateIndex := updateIndex - shift. - dX := dX + shift. - - self catchExpose. - self copyFrom:self - x:(org + shift) y:0 - toX:org y:0 - width:(gWidth - shift - margin) - height:height. - self clearRectangleX:(width - margin - shift) y:0 - width:shift height:height. - mustWait := true. - ]. - - self updateLineX:(updateIndex - 1 + org - 1) - total:total - old:oldSpaceSize "/ oldSpaceUsed - new:newSpaceUsed - free:freeMem. - - self updateNumbers. - mustWait ifTrue:[ - self waitForExpose. - ] - - ]. - - updateBlock notNil ifTrue:[ - Processor addTimedBlock:updateBlock afterSeconds:updateInterval - ]. + self clear. + self redrawX:0 y:0 width:width height:height ! redrawX:x y:y width:w height:h @@ -244,6 +177,90 @@ ] ! +updateDisplay + "update picture; trigger next update" + + |total oldSpaceUsed newSpaceUsed freeMem oldSpaceSize + gWidth shift scaleChange margin mustWait| + + shown ifTrue:[ + oldSpaceUsed := ObjectMemory oldSpaceUsed + ObjectMemory symSpaceUsed. + newSpaceUsed := ObjectMemory newSpaceUsed. + freeMem := ObjectMemory freeListSpace + (ObjectMemory oldSpaceSize - ObjectMemory oldSpaceUsed). + oldSpaceSize := ObjectMemory oldSpaceSize + ObjectMemory symSpaceSize. + total := oldSpaceSize + ObjectMemory newSpaceSize. + + scaleChange := false. + + ((total - freeMem) < minTotal) ifTrue:[ + minTotal := total - freeMem. + scaleChange := true + ]. + (total > maxTotal) ifTrue:[ + maxTotal := total. + scaleChange := true + ]. + + oldData at:updateIndex put:oldSpaceSize. "/ oldSpaceUsed. + newData at:updateIndex put:newSpaceUsed. + freeData at:updateIndex put:freeMem. + updateIndex := updateIndex + 1. + + scaleChange ifTrue:[ + scale := height asFloat / (maxTotal + 100000). + self redraw + ]. + + gWidth := width - org. + margin := 1. + + mustWait := false. + ((updateIndex-1) >= (gWidth - margin)) ifTrue:[ +"on slow displays, use:" +"/ shift := gWidth // 4. + +"for smooth display, use:" + shift := 1. + + oldData replaceFrom:1 with:oldData startingAt:shift+1. + newData replaceFrom:1 with:newData startingAt:shift+1. + freeData replaceFrom:1 with:freeData startingAt:shift+1. + + updateIndex := updateIndex - shift. + dX := dX + shift. + + self catchExpose. + self copyFrom:self + x:(org + shift) y:0 + toX:org y:0 + width:(gWidth - shift - margin) + height:height. + self clearRectangleX:(width - margin - shift) y:0 + width:shift height:height. + mustWait := true. + ]. + + self updateLineX:(updateIndex - 1 + org - 1) + total:total + old:oldSpaceSize "/ oldSpaceUsed + new:newSpaceUsed + free:freeMem. + + self updateNumbers. + self flush. + mustWait ifTrue:[ + self waitForExpose. + ] + + ]. + + updateBlock notNil ifTrue:[ + Processor addTimedBlock:updateBlock afterSeconds:updateInterval + ]. + + "Modified: 18.12.1995 / 15:21:10 / cg" +! + updateLineX:x total:total old:oldSpaceSize new:newSpaceUsed free:freeMem |hNew hOld hFree y1 y2 y3| @@ -410,30 +427,30 @@ self displayOpaqueString:s x:0 y:y. "Created: 7.11.1995 / 14:48:16 / cg" -! - -redraw - "redraw all" - - self clear. - self redrawX:0 y:0 width:width height:height -! ! - -!MemoryMonitor methodsFor:'destroying'! - -destroy - updateBlock notNil ifTrue:[ - Processor removeTimedBlock:updateBlock. - ] ifFalse:[ - myProcess terminate. - myProcess := nil - ]. - oldData := newData := freeData := nil. - super destroy ! ! !MemoryMonitor methodsFor:'events'! +keyPress:key x:x y:y + key == $f ifTrue:[ + "faster" + updateInterval := updateInterval / 2 + ]. + key == $s ifTrue:[ + "slower" + updateInterval := updateInterval * 2 + ]. + key == $r ifTrue:[ + "reset max" + maxTotal := prevTotal. + scale := height asFloat / (maxTotal + 100000). + self resetStatisticValues. + self redraw. + ] + + "Modified: 7.11.1995 / 17:45:13 / cg" +! + sizeChanged:how |nn no nf delta oldSize newSize| @@ -468,30 +485,51 @@ ]. self clear. self redraw. -! - -keyPress:key x:x y:y - key == $f ifTrue:[ - "faster" - updateInterval := updateInterval / 2 - ]. - key == $s ifTrue:[ - "slower" - updateInterval := updateInterval * 2 - ]. - key == $r ifTrue:[ - "reset max" - maxTotal := prevTotal. - scale := height asFloat / (maxTotal + 100000). - self resetStatisticValues. - self redraw. - ] - - "Modified: 7.11.1995 / 17:45:13 / cg" ! ! !MemoryMonitor methodsFor:'initialization'! +initialize + super initialize. + + updateInterval := 0.5. + ProcessorScheduler isPureEventDriven ifTrue:[ + updateBlock := [self updateDisplay]. + ]. + oldData := Array new:1000. + newData := Array new:1000. + freeData := Array new:1000. + + updateIndex := 1. + org := font widthOf:'max 99999k'. + level := 0. + + maxTotal := minTotal := ObjectMemory oldSpaceSize + + ObjectMemory symSpaceSize + + ObjectMemory newSpaceSize. + + viewBackground := Black. + + device hasColors ifTrue:[ + newColor := Color orange. "/ yellow. + freeColor := Color green. + oldColor := Color white. + ] ifFalse:[ + newColor := Color grey:67. + freeColor := Color grey:33. + oldColor := Color white. + ]. + + self font:(Font family:'courier' face:'medium' style:'roman' size:10). + + self model:self. + self menu:#memoryMenu + + " + MemoryMonitor open + " +! + memoryMenu |labels selectors| @@ -562,51 +600,20 @@ oldColor := oldColor on:device. font := font on:device. -! - -initialize - super initialize. - - updateInterval := 0.5. - ProcessorScheduler isPureEventDriven ifTrue:[ - updateBlock := [self updateDisplay]. - ]. - oldData := Array new:1000. - newData := Array new:1000. - freeData := Array new:1000. - - updateIndex := 1. - org := font widthOf:'max 99999k'. - level := 0. - - maxTotal := minTotal := ObjectMemory oldSpaceSize - + ObjectMemory symSpaceSize - + ObjectMemory newSpaceSize. - - viewBackground := Black. - - device hasColors ifTrue:[ - newColor := Color orange. "/ yellow. - freeColor := Color green. - oldColor := Color white. - ] ifFalse:[ - newColor := Color grey:67. - freeColor := Color grey:33. - oldColor := Color white. - ]. - - self font:(Font family:'courier' face:'medium' style:'roman' size:10). - - self model:self. - self menu:#memoryMenu - - " - MemoryMonitor open - " ! ! !MemoryMonitor methodsFor:'menu functions'! +backgroundCollect + "start a background (non disturbing) incremental GC. + Since the GC is performed at a low priority, it may not make progress if higher + prio processes are running" + + [ + ObjectMemory incrementalGC + ] forkAt:5 +! + cleanupMemory "let all classes release unneeded, cached data ..." @@ -624,11 +631,15 @@ ObjectMemory verboseGarbageCollect. ! -resetStatisticValues - ObjectMemory resetMaxInterruptLatency. - ObjectMemory resetMinScavengeReclamation. +compressSources + Smalltalk compressSources. + ObjectMemory markAndSweep +! - "Created: 7.11.1995 / 17:44:59 / cg" +compressingGarbageCollect + "perform a blocking compressing garbage collect." + + ObjectMemory verboseGarbageCollect ! garbageCollect @@ -644,10 +655,22 @@ ObjectMemory reclaimSymbols ! -compressingGarbageCollect - "perform a blocking compressing garbage collect." +incrementalCollect + "start an incremental GC which does not disturb too much, but is guaranteed to + make progress. + This is done by doing the igc at a very high priority, but giving up the CPU after + every step. Due to the amount of context switches, this may take a while to finish." + + [ + [ObjectMemory gcStep] whileFalse:[(Delay forMilliseconds:1) wait] + ] forkAt:Processor highestPriority +! - ObjectMemory verboseGarbageCollect +resetStatisticValues + ObjectMemory resetMaxInterruptLatency. + ObjectMemory resetMinScavengeReclamation. + + "Created: 7.11.1995 / 17:44:59 / cg" ! scavenge @@ -663,30 +686,10 @@ (this is for debugging only - the system does this automatically)" ObjectMemory tenure -! +! ! -compressSources - Smalltalk compressSources. - ObjectMemory markAndSweep -! +!MemoryMonitor class methodsFor:'documentation'! -incrementalCollect - "start an incremental GC which does not disturb too much, but is guaranteed to - make progress. - This is done by doing the igc at a very high priority, but giving up the CPU after - every step. Due to the amount of context switches, this may take a while to finish." - - [ - [ObjectMemory gcStep] whileFalse:[(Delay forMilliseconds:1) wait] - ] forkAt:Processor highestPriority -! - -backgroundCollect - "start a background (non disturbing) incremental GC. - Since the GC is performed at a low priority, it may not make progress if higher - prio processes are running" - - [ - ObjectMemory incrementalGC - ] forkAt:5 +version + ^ '$Header: /cvs/stx/stx/libtool/Attic/MemMonitor.st,v 1.29 1995-12-18 14:23:08 cg Exp $' ! ! diff -r 8731287abedd -r c118ce1f8afd MemoryMonitor.st --- a/MemoryMonitor.st Sun Dec 17 15:47:14 1995 +0100 +++ b/MemoryMonitor.st Mon Dec 18 15:23:08 1995 +0100 @@ -10,15 +10,13 @@ hereby transferred. " -'From Smalltalk/X, Version:2.10.5 on 22-mar-1995 at 7:43:35 am'! - StandardSystemView subclass:#MemoryMonitor - instanceVariableNames:'updateInterval updateBlock myProcess oldData newData freeData + instanceVariableNames:'updateInterval updateBlock myProcess oldData newData freeData updateIndex org maxTotal minTotal dX newColor freeColor oldColor prevTotal prevFree prevFree2 prevOld scale' - classVariableNames:'' - poolDictionaries:'' - category:'Interface-Tools' + classVariableNames:'' + poolDictionaries:'' + category:'Interface-Tools' ! !MemoryMonitor class methodsFor:'documentation'! @@ -37,10 +35,6 @@ " ! -version - ^ '$Header: /cvs/stx/stx/libtool/MemoryMonitor.st,v 1.28 1995-12-15 12:13:22 cg Exp $' -! - documentation " Shows memory usage (oldspace + newspace). Simple, but useful. @@ -96,99 +90,38 @@ ^ (200 @ 280) ! -defaultLabel - ^ 'Memory Monitor' -! - defaultIcon |i| i := Image fromFile:'MemMonitor.xbm'. i notNil ifTrue:[^ i]. ^ super defaultIcon +! + +defaultLabel + ^ 'Memory Monitor' +! ! + +!MemoryMonitor methodsFor:'destroying'! + +destroy + updateBlock notNil ifTrue:[ + Processor removeTimedBlock:updateBlock. + ] ifFalse:[ + myProcess terminate. + myProcess := nil + ]. + oldData := newData := freeData := nil. + super destroy ! ! !MemoryMonitor methodsFor:'drawing'! -updateDisplay - "update picture; trigger next update" - - |total oldSpaceUsed newSpaceUsed freeMem oldSpaceSize - gWidth shift scaleChange margin mustWait| - - shown ifTrue:[ - oldSpaceUsed := ObjectMemory oldSpaceUsed + ObjectMemory symSpaceUsed. - newSpaceUsed := ObjectMemory newSpaceUsed. - freeMem := ObjectMemory freeListSpace + (ObjectMemory oldSpaceSize - ObjectMemory oldSpaceUsed). - oldSpaceSize := ObjectMemory oldSpaceSize + ObjectMemory symSpaceSize. - total := oldSpaceSize + ObjectMemory newSpaceSize. - - scaleChange := false. - - ((total - freeMem) < minTotal) ifTrue:[ - minTotal := total - freeMem. - scaleChange := true - ]. - (total > maxTotal) ifTrue:[ - maxTotal := total. - scaleChange := true - ]. - - oldData at:updateIndex put:oldSpaceSize. "/ oldSpaceUsed. - newData at:updateIndex put:newSpaceUsed. - freeData at:updateIndex put:freeMem. - updateIndex := updateIndex + 1. - - scaleChange ifTrue:[ - scale := height asFloat / (maxTotal + 100000). - self redraw - ]. - - gWidth := width - org. - margin := 1. +redraw + "redraw all" - mustWait := false. - ((updateIndex-1) >= (gWidth - margin)) ifTrue:[ -"on slow displays, use:" -"/ shift := gWidth // 4. - -"for smooth display, use:" - shift := 1. - - oldData replaceFrom:1 with:oldData startingAt:shift+1. - newData replaceFrom:1 with:newData startingAt:shift+1. - freeData replaceFrom:1 with:freeData startingAt:shift+1. - - updateIndex := updateIndex - shift. - dX := dX + shift. - - self catchExpose. - self copyFrom:self - x:(org + shift) y:0 - toX:org y:0 - width:(gWidth - shift - margin) - height:height. - self clearRectangleX:(width - margin - shift) y:0 - width:shift height:height. - mustWait := true. - ]. - - self updateLineX:(updateIndex - 1 + org - 1) - total:total - old:oldSpaceSize "/ oldSpaceUsed - new:newSpaceUsed - free:freeMem. - - self updateNumbers. - mustWait ifTrue:[ - self waitForExpose. - ] - - ]. - - updateBlock notNil ifTrue:[ - Processor addTimedBlock:updateBlock afterSeconds:updateInterval - ]. + self clear. + self redrawX:0 y:0 width:width height:height ! redrawX:x y:y width:w height:h @@ -244,6 +177,90 @@ ] ! +updateDisplay + "update picture; trigger next update" + + |total oldSpaceUsed newSpaceUsed freeMem oldSpaceSize + gWidth shift scaleChange margin mustWait| + + shown ifTrue:[ + oldSpaceUsed := ObjectMemory oldSpaceUsed + ObjectMemory symSpaceUsed. + newSpaceUsed := ObjectMemory newSpaceUsed. + freeMem := ObjectMemory freeListSpace + (ObjectMemory oldSpaceSize - ObjectMemory oldSpaceUsed). + oldSpaceSize := ObjectMemory oldSpaceSize + ObjectMemory symSpaceSize. + total := oldSpaceSize + ObjectMemory newSpaceSize. + + scaleChange := false. + + ((total - freeMem) < minTotal) ifTrue:[ + minTotal := total - freeMem. + scaleChange := true + ]. + (total > maxTotal) ifTrue:[ + maxTotal := total. + scaleChange := true + ]. + + oldData at:updateIndex put:oldSpaceSize. "/ oldSpaceUsed. + newData at:updateIndex put:newSpaceUsed. + freeData at:updateIndex put:freeMem. + updateIndex := updateIndex + 1. + + scaleChange ifTrue:[ + scale := height asFloat / (maxTotal + 100000). + self redraw + ]. + + gWidth := width - org. + margin := 1. + + mustWait := false. + ((updateIndex-1) >= (gWidth - margin)) ifTrue:[ +"on slow displays, use:" +"/ shift := gWidth // 4. + +"for smooth display, use:" + shift := 1. + + oldData replaceFrom:1 with:oldData startingAt:shift+1. + newData replaceFrom:1 with:newData startingAt:shift+1. + freeData replaceFrom:1 with:freeData startingAt:shift+1. + + updateIndex := updateIndex - shift. + dX := dX + shift. + + self catchExpose. + self copyFrom:self + x:(org + shift) y:0 + toX:org y:0 + width:(gWidth - shift - margin) + height:height. + self clearRectangleX:(width - margin - shift) y:0 + width:shift height:height. + mustWait := true. + ]. + + self updateLineX:(updateIndex - 1 + org - 1) + total:total + old:oldSpaceSize "/ oldSpaceUsed + new:newSpaceUsed + free:freeMem. + + self updateNumbers. + self flush. + mustWait ifTrue:[ + self waitForExpose. + ] + + ]. + + updateBlock notNil ifTrue:[ + Processor addTimedBlock:updateBlock afterSeconds:updateInterval + ]. + + "Modified: 18.12.1995 / 15:21:10 / cg" +! + updateLineX:x total:total old:oldSpaceSize new:newSpaceUsed free:freeMem |hNew hOld hFree y1 y2 y3| @@ -410,30 +427,30 @@ self displayOpaqueString:s x:0 y:y. "Created: 7.11.1995 / 14:48:16 / cg" -! - -redraw - "redraw all" - - self clear. - self redrawX:0 y:0 width:width height:height -! ! - -!MemoryMonitor methodsFor:'destroying'! - -destroy - updateBlock notNil ifTrue:[ - Processor removeTimedBlock:updateBlock. - ] ifFalse:[ - myProcess terminate. - myProcess := nil - ]. - oldData := newData := freeData := nil. - super destroy ! ! !MemoryMonitor methodsFor:'events'! +keyPress:key x:x y:y + key == $f ifTrue:[ + "faster" + updateInterval := updateInterval / 2 + ]. + key == $s ifTrue:[ + "slower" + updateInterval := updateInterval * 2 + ]. + key == $r ifTrue:[ + "reset max" + maxTotal := prevTotal. + scale := height asFloat / (maxTotal + 100000). + self resetStatisticValues. + self redraw. + ] + + "Modified: 7.11.1995 / 17:45:13 / cg" +! + sizeChanged:how |nn no nf delta oldSize newSize| @@ -468,30 +485,51 @@ ]. self clear. self redraw. -! - -keyPress:key x:x y:y - key == $f ifTrue:[ - "faster" - updateInterval := updateInterval / 2 - ]. - key == $s ifTrue:[ - "slower" - updateInterval := updateInterval * 2 - ]. - key == $r ifTrue:[ - "reset max" - maxTotal := prevTotal. - scale := height asFloat / (maxTotal + 100000). - self resetStatisticValues. - self redraw. - ] - - "Modified: 7.11.1995 / 17:45:13 / cg" ! ! !MemoryMonitor methodsFor:'initialization'! +initialize + super initialize. + + updateInterval := 0.5. + ProcessorScheduler isPureEventDriven ifTrue:[ + updateBlock := [self updateDisplay]. + ]. + oldData := Array new:1000. + newData := Array new:1000. + freeData := Array new:1000. + + updateIndex := 1. + org := font widthOf:'max 99999k'. + level := 0. + + maxTotal := minTotal := ObjectMemory oldSpaceSize + + ObjectMemory symSpaceSize + + ObjectMemory newSpaceSize. + + viewBackground := Black. + + device hasColors ifTrue:[ + newColor := Color orange. "/ yellow. + freeColor := Color green. + oldColor := Color white. + ] ifFalse:[ + newColor := Color grey:67. + freeColor := Color grey:33. + oldColor := Color white. + ]. + + self font:(Font family:'courier' face:'medium' style:'roman' size:10). + + self model:self. + self menu:#memoryMenu + + " + MemoryMonitor open + " +! + memoryMenu |labels selectors| @@ -562,51 +600,20 @@ oldColor := oldColor on:device. font := font on:device. -! - -initialize - super initialize. - - updateInterval := 0.5. - ProcessorScheduler isPureEventDriven ifTrue:[ - updateBlock := [self updateDisplay]. - ]. - oldData := Array new:1000. - newData := Array new:1000. - freeData := Array new:1000. - - updateIndex := 1. - org := font widthOf:'max 99999k'. - level := 0. - - maxTotal := minTotal := ObjectMemory oldSpaceSize - + ObjectMemory symSpaceSize - + ObjectMemory newSpaceSize. - - viewBackground := Black. - - device hasColors ifTrue:[ - newColor := Color orange. "/ yellow. - freeColor := Color green. - oldColor := Color white. - ] ifFalse:[ - newColor := Color grey:67. - freeColor := Color grey:33. - oldColor := Color white. - ]. - - self font:(Font family:'courier' face:'medium' style:'roman' size:10). - - self model:self. - self menu:#memoryMenu - - " - MemoryMonitor open - " ! ! !MemoryMonitor methodsFor:'menu functions'! +backgroundCollect + "start a background (non disturbing) incremental GC. + Since the GC is performed at a low priority, it may not make progress if higher + prio processes are running" + + [ + ObjectMemory incrementalGC + ] forkAt:5 +! + cleanupMemory "let all classes release unneeded, cached data ..." @@ -624,11 +631,15 @@ ObjectMemory verboseGarbageCollect. ! -resetStatisticValues - ObjectMemory resetMaxInterruptLatency. - ObjectMemory resetMinScavengeReclamation. +compressSources + Smalltalk compressSources. + ObjectMemory markAndSweep +! - "Created: 7.11.1995 / 17:44:59 / cg" +compressingGarbageCollect + "perform a blocking compressing garbage collect." + + ObjectMemory verboseGarbageCollect ! garbageCollect @@ -644,10 +655,22 @@ ObjectMemory reclaimSymbols ! -compressingGarbageCollect - "perform a blocking compressing garbage collect." +incrementalCollect + "start an incremental GC which does not disturb too much, but is guaranteed to + make progress. + This is done by doing the igc at a very high priority, but giving up the CPU after + every step. Due to the amount of context switches, this may take a while to finish." + + [ + [ObjectMemory gcStep] whileFalse:[(Delay forMilliseconds:1) wait] + ] forkAt:Processor highestPriority +! - ObjectMemory verboseGarbageCollect +resetStatisticValues + ObjectMemory resetMaxInterruptLatency. + ObjectMemory resetMinScavengeReclamation. + + "Created: 7.11.1995 / 17:44:59 / cg" ! scavenge @@ -663,30 +686,10 @@ (this is for debugging only - the system does this automatically)" ObjectMemory tenure -! +! ! -compressSources - Smalltalk compressSources. - ObjectMemory markAndSweep -! +!MemoryMonitor class methodsFor:'documentation'! -incrementalCollect - "start an incremental GC which does not disturb too much, but is guaranteed to - make progress. - This is done by doing the igc at a very high priority, but giving up the CPU after - every step. Due to the amount of context switches, this may take a while to finish." - - [ - [ObjectMemory gcStep] whileFalse:[(Delay forMilliseconds:1) wait] - ] forkAt:Processor highestPriority -! - -backgroundCollect - "start a background (non disturbing) incremental GC. - Since the GC is performed at a low priority, it may not make progress if higher - prio processes are running" - - [ - ObjectMemory incrementalGC - ] forkAt:5 +version + ^ '$Header: /cvs/stx/stx/libtool/MemoryMonitor.st,v 1.29 1995-12-18 14:23:08 cg Exp $' ! !