MemoryMonitor.st
changeset 75 f6310cbc93b6
parent 68 b70257a99e48
child 79 d78f92a07d5d
--- a/MemoryMonitor.st	Mon Mar 06 20:30:54 1995 +0100
+++ b/MemoryMonitor.st	Mon Mar 06 20:32:18 1995 +0100
@@ -24,7 +24,7 @@
  COPYRIGHT (c) 1991 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libtool/MemoryMonitor.st,v 1.9 1995-02-19 15:54:18 claus Exp $
+$Header: /cvs/stx/stx/libtool/MemoryMonitor.st,v 1.10 1995-03-06 19:31:50 claus Exp $
 '!
 
 !MemoryMonitor class methodsFor:'documentation'!
@@ -45,7 +45,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libtool/MemoryMonitor.st,v 1.9 1995-02-19 15:54:18 claus Exp $
+$Header: /cvs/stx/stx/libtool/MemoryMonitor.st,v 1.10 1995-03-06 19:31:50 claus Exp $
 "
 !
 
@@ -295,7 +295,8 @@
     y := y + fontHeight.
     n := ObjectMemory lastScavangeReclamation / ObjectMemory newSpaceSize * 100.0.
     n := 100 - n asInteger.
-    s := (n printStringLeftPaddedTo:2) , '%'.
+    s := (ObjectMemory scavengeCount printStringLeftPaddedTo:5)
+	 , (n printStringLeftPaddedTo:3) , '%'.
     self displayOpaqueString:s x:0 y:y.
 !
 
@@ -506,27 +507,38 @@
 
     self font:(Font family:'courier' face:'medium' style:'roman' size:10).
 
+    self model:self.
+    self menu:#memoryMenu
+
     "
      MemoryMonitor open
     "
 !
 
-initializeMiddleButtonMenu
-    self middleButtonMenu:
-	     (PopUpMenu labels:(resources array:#(
-						  'collect Garbage'
-						  'collect Garbage & compress'
-						  '-'
-						  'background collect'
-						 ))
-			selectors:#(
-			    garbageCollect
-			    compressingGarbageCollect
-			    nil
-			    backgroundCollect
-			   )
+memoryMenu
+    |labels selectors|
+
+    labels :=    #(
+		    'collect Garbage'
+		    'collect Garbage & compress'
+		    '-'
+		    'background collect'
+		    '-'
+		    'compress sources '
+		  ).
+
+    selectors := #(
+		    garbageCollect
+		    compressingGarbageCollect
+		    nil
+		    backgroundCollect
+		    nil
+		    compressSources
+		  ).
+
+    ^ PopUpMenu labels:(resources array:labels)
+		 selectors:selectors
 		receiver:self
-		     for:self)
 ! !
 
 !MemoryMonitor methodsFor:'menu functions'!
@@ -541,5 +553,10 @@
 
 backgroundCollect
     [ObjectMemory incrementalGC] forkAt:4
+!
+
+compressSources
+    Smalltalk compressSources.
+    ObjectMemory markAndSweep
 ! !