ObjectMemory.st
changeset 8304 c82abebade70
parent 8252 16ed6cd9868d
child 8423 b5b2d689e684
equal deleted inserted replaced
8303:837daadaab78 8304:c82abebade70
   793     "
   793     "
   794      ObjectMemory numOopsNumBytes 
   794      ObjectMemory numOopsNumBytes 
   795     "
   795     "
   796 
   796 
   797     "Modified: 29.1.1997 / 23:44:24 / cg"
   797     "Modified: 29.1.1997 / 23:44:24 / cg"
       
   798 !
       
   799 
       
   800 verboseCompactingGC
       
   801     "ST80 compatibility; same as verboseGarbageCollect"
       
   802 
       
   803     self verboseGarbageCollect
       
   804 !
       
   805 
       
   806 verboseGlobalCompactingGC
       
   807     "ST80 compatibility; same as verboseGarbageCollect"
       
   808 
       
   809     self verboseGarbageCollect
   798 !
   810 !
   799 
   811 
   800 versionId
   812 versionId
   801     "return this systems version.
   813     "return this systems version.
   802      For ST80 compatibility."
   814      For ST80 compatibility."
  2246     "
  2258     "
  2247      ObjectMemory markAndSweep
  2259      ObjectMemory markAndSweep
  2248     "
  2260     "
  2249 !
  2261 !
  2250 
  2262 
       
  2263 nonVerboseGarbageCollect
       
  2264     "perform a compressing garbage collect or fallback to non-compressing collect,
       
  2265      if required."
       
  2266 
       
  2267     "/ try 1pass baker collect first.
       
  2268     "/ this will fail if oldSpace size is above compressLimit
       
  2269     (self compressingGarbageCollect) ifFalse:[
       
  2270         "/ fallBack - use 2pass inplace compress
       
  2271         self compressOldSpace
       
  2272     ].
       
  2273 
       
  2274     "
       
  2275      ObjectMemory nonVerboseGarbageCollect
       
  2276     "
       
  2277 !
       
  2278 
  2251 reclaimSymbols
  2279 reclaimSymbols
  2252     "reclaim unused symbols;
  2280     "reclaim unused symbols;
  2253      Unused symbols are (currently) not reclaimed automatically,
  2281      Unused symbols are (currently) not reclaimed automatically,
  2254      but only upon request with this method. 
  2282      but only upon request with this method. 
  2255      It takes some time to do this ... and it is NOT interruptable.
  2283      It takes some time to do this ... and it is NOT interruptable.
  2419     "
  2447     "
  2420      ObjectMemory tenuringScavenge
  2448      ObjectMemory tenuringScavenge
  2421     "
  2449     "
  2422 !
  2450 !
  2423 
  2451 
  2424 verboseCompactingGC
       
  2425     "ST80 compatibility; same as verboseGarbageCollect"
       
  2426 
       
  2427     self verboseGarbageCollect
       
  2428 !
       
  2429 
       
  2430 verboseGarbageCollect
  2452 verboseGarbageCollect
  2431     "perform a compressing garbage collect and show some informational
  2453     "perform a compressing garbage collect and show some informational
  2432      output on the Transcript"
  2454      output on the Transcript"
  2433 
  2455 
  2434     |nBytesBefore nReclaimed value unit|
  2456     |nBytesBefore nReclaimed value unit|
  2435 
  2457 
  2436     nBytesBefore := self oldSpaceUsed.
  2458     nBytesBefore := self oldSpaceUsed.
  2437 
  2459 
  2438     "/ try 1pass baker collect first.
  2460     self nonVerboseGarbageCollect.
  2439     "/ this will fail if oldSpace size is above compressLimit
       
  2440     (self compressingGarbageCollect) ifFalse:[
       
  2441 	"/ fallBack - use 2pass inplace compress
       
  2442 	self compressOldSpace
       
  2443     ].
       
  2444 
  2461 
  2445     "/ show what we reclaimed
  2462     "/ show what we reclaimed
  2446     nReclaimed := nBytesBefore - self oldSpaceUsed.
  2463     nReclaimed := nBytesBefore - self oldSpaceUsed.
  2447     nReclaimed > 0 ifTrue:[
  2464     nReclaimed > 0 ifTrue:[
  2448 	nReclaimed > 1024 ifTrue:[
  2465         nReclaimed > 1024 ifTrue:[
  2449 	    nReclaimed > (1024 * 1024) ifTrue:[
  2466             nReclaimed > (1024 * 1024) ifTrue:[
  2450 		value := nReclaimed * 10 // (1024 * 1024) / 10.0.
  2467                 value := nReclaimed * 10 // (1024 * 1024) / 10.0.
  2451 		unit := ' Mb.'
  2468                 unit := ' Mb.'
  2452 	    ] ifFalse:[
  2469             ] ifFalse:[
  2453 		value := nReclaimed // 1024.
  2470                 value := nReclaimed // 1024.
  2454 		unit := ' Kb.'
  2471                 unit := ' Kb.'
  2455 	    ]
  2472             ]
  2456 	] ifFalse:[
  2473         ] ifFalse:[
  2457 	    value := nReclaimed.
  2474             value := nReclaimed.
  2458 	    unit := ' bytes.'
  2475             unit := ' bytes.'
  2459 	].
  2476         ].
  2460 	Transcript show:'reclaimed '; show:value.
  2477         Transcript show:'reclaimed '; show:value.
  2461 	Transcript showCR:unit
  2478         Transcript showCR:unit
  2462     ]
  2479     ]
  2463 
  2480 
  2464     "
  2481     "
  2465      ObjectMemory verboseGarbageCollect
  2482      ObjectMemory verboseGarbageCollect
  2466     "
  2483     "
  2467 
  2484 
  2468     "Modified: / 15.7.1998 / 13:28:05 / cg"
  2485     "Modified: / 15.7.1998 / 13:28:05 / cg"
  2469 !
       
  2470 
       
  2471 verboseGlobalCompactingGC
       
  2472     "ST80 compatibility; same as verboseGarbageCollect"
       
  2473 
       
  2474     self verboseGarbageCollect
       
  2475 ! !
  2486 ! !
  2476 
  2487 
  2477 !ObjectMemory class methodsFor:'garbage collector control'!
  2488 !ObjectMemory class methodsFor:'garbage collector control'!
  2478 
  2489 
  2479 announceOldSpaceNeed:howMuch
  2490 announceOldSpaceNeed:howMuch
  5053 ! !
  5064 ! !
  5054 
  5065 
  5055 !ObjectMemory class methodsFor:'documentation'!
  5066 !ObjectMemory class methodsFor:'documentation'!
  5056 
  5067 
  5057 version
  5068 version
  5058     ^ '$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.211 2004-03-20 15:37:20 stefan Exp $'
  5069     ^ '$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.212 2004-04-07 10:27:55 werner Exp $'
  5059 ! !
  5070 ! !
  5060 
  5071 
  5061 ObjectMemory initialize!
  5072 ObjectMemory initialize!