MemoryMonitor.st
changeset 696 b55f8705bb41
parent 517 cc3d4e0fc758
child 735 600fe3dab131
--- a/MemoryMonitor.st	Thu Aug 22 15:30:50 1996 +0200
+++ b/MemoryMonitor.st	Sat Aug 24 12:07:24 1996 +0200
@@ -19,7 +19,7 @@
 	category:'Interface-Tools'
 !
 
-!MemoryMonitor class methodsFor:'documentation'!
+!MemoryMonitor  class methodsFor:'documentation'!
 
 copyright
 "
@@ -53,12 +53,14 @@
 
         old     current oldSpace in use
 
+        cod     dynamic compiled code space size (just in time compiler)
+
         max,    extreme values of 'tot' since the monitor started
         min     (can be reset by typing 'r' in the view)
 
-        t       tenure threshold
+        t       tenure threshold (1 .. 30)
 
-        I       incremental GC state
+        I       incremental GC state (2 = idle)
 
         weak    number of weak objects
 
@@ -74,7 +76,7 @@
                  newSpace objects after the last scavenge)
 
     the graphic shows:
-        yellow  newSpace used
+        orange  newSpace used
         green   free memory in freeLists
         white   oldSpace used
 
@@ -91,10 +93,12 @@
 "
 ! !
 
-!MemoryMonitor class methodsFor:'defaults'!
+!MemoryMonitor  class methodsFor:'defaults'!
 
 defaultExtent
-    ^ (200 @ 280)
+    ^ (200 @ 320)
+
+    "Modified: 24.8.1996 / 12:04:21 / cg"
 !
 
 defaultIcon
@@ -293,21 +297,21 @@
 updateNumbers
     "redraw numbers.
      The values shown are:
-	max:    maximum memory used since monitor started
-	min:    minimum memory used since monitor started
-	tot:    total memory used (overall oldSpace + overall newSpace)
-	all:    current memory in use (oldSpace + newSpace)
-	new:    current newSpace in use
-	free:   current size of freelist in oldSpace
-	old:    current oldSpace in use
-	t:      current tenure age
-	I:      IGC state
-	weak:   number of weak arrays in the system
-	rem     remembered set size
-	lrem    lifo remembered set size
-	minsc:  percent of newspace remaining after scavenge (worst case)
-	irq:    max. interrupt delay
-	count of scavenges / last scavenge survivor rate
+        max:    maximum memory used since monitor started
+        min:    minimum memory used since monitor started
+        tot:    total memory used (overall oldSpace + overall newSpace)
+        all:    current memory in use (oldSpace + newSpace)
+        new:    current newSpace in use
+        free:   current size of freelist in oldSpace
+        old:    current oldSpace in use
+        t:      current tenure age
+        I:      IGC state
+        weak:   number of weak arrays in the system
+        rem     remembered set size
+        lrem    lifo remembered set size
+        minsc:  percent of newspace remaining after scavenge (worst case)
+        irq:    max. interrupt delay
+        count of scavenges / last scavenge survivor rate
 
     "
 
@@ -332,23 +336,23 @@
     y := half - (fontHeight * 5).
 
     total ~~ prevTotal ifTrue:[
-	((total - freeMem) < minTotal) ifTrue:[
-	    minTotal := total - freeMem.
-	].
-	(total > maxTotal) ifTrue:[
-	    maxTotal := total.
-	].
+        ((total - freeMem) < minTotal) ifTrue:[
+            minTotal := total - freeMem.
+        ].
+        (total > maxTotal) ifTrue:[
+            maxTotal := total.
+        ].
 
-	s := 'max ' , ((maxTotal // 1024) printStringLeftPaddedTo:5) , 'k '.
-	self displayOpaqueString:s x:0 y:font ascent.
+        s := 'max ' , ((maxTotal // 1024) printStringLeftPaddedTo:5) , 'k '.
+        self displayOpaqueString:s x:0 y:font ascent.
 
-	s := 'min ' , ((minTotal // 1024) printStringLeftPaddedTo:5) , 'k '.
-	self displayOpaqueString:s x:0 y:(height - font descent).
+        s := 'min ' , ((minTotal // 1024) printStringLeftPaddedTo:5) , 'k '.
+        self displayOpaqueString:s x:0 y:(height - font descent).
 
-	s := 'tot ' , ((total  // 1024) printStringLeftPaddedTo:5) , 'k '.
-	self displayOpaqueString:s x:0 y:y.
+        s := 'tot ' , ((total  // 1024) printStringLeftPaddedTo:5) , 'k '.
+        self displayOpaqueString:s x:0 y:y.
 
-	prevTotal := total.
+        prevTotal := total.
     ].
 
     y := y + fontHeight.
@@ -362,26 +366,38 @@
 
     y := y + fontHeight.
     freeMem ~~ prevFree ifTrue:[
-	self paint:freeColor.
-	s := 'frl ' , ((freeMem // 1024) printStringLeftPaddedTo:5) , 'k '.
-	self displayOpaqueString:s x:0 y:y.
-	prevFree := freeMem.
+        self paint:freeColor.
+        s := 'frl ' , ((freeMem // 1024) printStringLeftPaddedTo:5) , 'k '.
+        self displayOpaqueString:s x:0 y:y.
+        prevFree := freeMem.
     ].
 
     y := y + fontHeight.
     free2 ~~ prevFree2 ifTrue:[
-	self paint:freeColor.
-	s := 'fre ' , ((free2 // 1024) printStringLeftPaddedTo:5) , 'k '.
-	self displayOpaqueString:s x:0 y:y.
-	prevFree2 := free2.
+        self paint:freeColor.
+        s := 'fre ' , ((free2 // 1024) printStringLeftPaddedTo:5) , 'k '.
+        self displayOpaqueString:s x:0 y:y.
+        prevFree2 := free2.
     ].
 
     y := y + fontHeight.
     (oldMemUsed - freeMem) ~~ prevOld ifTrue:[
-	self paint:oldColor.
-	s := 'old ' , (((oldMemUsed - freeMem) // 1024) printStringLeftPaddedTo:5) , 'k '.
-	self displayOpaqueString:s x:0 y:y.
-	prevOld := (oldMemUsed - freeMem).
+        self paint:oldColor.
+        s := 'old ' , (((oldMemUsed - freeMem) // 1024) printStringLeftPaddedTo:5) , 'k '.
+        self displayOpaqueString:s x:0 y:y.
+        prevOld := (oldMemUsed - freeMem).
+    ].
+
+    ObjectMemory supportsJustInTimeCompilation ifTrue:[
+        y := y + fontHeight.
+        self paint:oldColor.
+        n := ObjectMemory compiledCodeSpaceUsed.
+        n > 9999 ifTrue:[
+            s := 'cod ' , ((n // 1024) printStringLeftPaddedTo:5) , 'k'.
+        ] ifFalse:[
+            s := 'cod ' , (n printStringLeftPaddedTo:5) , ' '.
+        ].
+        self displayOpaqueString:s x:0 y:y.
     ].
 
     "
@@ -420,9 +436,9 @@
     y := y + fontHeight.
     n := ObjectMemory maxInterruptLatency.
     n notNil ifTrue:[
-	s := 'irq ', (n printStringLeftPaddedTo:3) , ' ms'.
+        s := 'irq ', (n printStringLeftPaddedTo:3) , ' ms'.
     ] ifFalse:[
-	s := ''
+        s := ''
     ].
     self displayOpaqueString:s x:0 y:y.
 
@@ -430,10 +446,11 @@
     n := ObjectMemory lastScavengeReclamation / ObjectMemory newSpaceSize * 100.0.
     n := 100 - n asInteger.
     s := (ObjectMemory scavengeCount printStringLeftPaddedTo:6)
-	 , (n printStringLeftPaddedTo:3) , '%'.
+         , (n printStringLeftPaddedTo:3) , '%'.
     self displayOpaqueString:s x:0 y:y.
 
     "Created: 7.11.1995 / 14:48:16 / cg"
+    "Modified: 24.8.1996 / 11:57:22 / cg"
 ! !
 
 !MemoryMonitor methodsFor:'events'!
@@ -751,8 +768,8 @@
     ObjectMemory tenure
 ! !
 
-!MemoryMonitor class methodsFor:'documentation'!
+!MemoryMonitor  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/MemoryMonitor.st,v 1.35 1996-04-27 17:59:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/MemoryMonitor.st,v 1.36 1996-08-24 10:07:24 cg Exp $'
 ! !