MemoryMonitor.st
author Claus Gittinger <cg@exept.de>
Wed, 25 Aug 1999 16:03:47 +0200
changeset 2355 5c881cb45539
parent 2117 dd96b2478eeb
child 2362 d1314d621204
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
     1
"
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
     2
 COPYRIGHT (c) 1991 by Claus Gittinger
45
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
     3
	      All Rights Reserved
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
     4
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
     5
 This software is furnished under a license and may be used
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
     6
 only in accordance with the terms of that license and with the
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
     8
 be provided or otherwise made available to, or used by, any
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
     9
 other person.  No title to or ownership of the software is
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
    10
 hereby transferred.
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
    11
"
19
4cde336c0794 Initial revision
claus
parents:
diff changeset
    12
4cde336c0794 Initial revision
claus
parents:
diff changeset
    13
StandardSystemView subclass:#MemoryMonitor
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
    14
	instanceVariableNames:'updateInterval updateBlock myProcess oldData newData freeData
93
claus
parents: 91
diff changeset
    15
		updateIndex org maxTotal minTotal dX newColor freeColor oldColor
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
    16
		prevTotal prevFree prevFree2 prevOld scale drawLock prevMemUsed
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
    17
		prevCodeUsed prevNumWeak prevNumRem prevNumLifoRem prevTenureAge
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
    18
		prevIGCPhase prevLastScavengeReclamation
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
    19
		prevMinScavengeReclamation prevScavengeCount'
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
    20
	classVariableNames:''
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
    21
	poolDictionaries:''
1053
9b1b15ef1e34 category change
Claus Gittinger <cg@exept.de>
parents: 1052
diff changeset
    22
	category:'Monitors-ST/X'
19
4cde336c0794 Initial revision
claus
parents:
diff changeset
    23
!
4cde336c0794 Initial revision
claus
parents:
diff changeset
    24
798
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    25
!MemoryMonitor class methodsFor:'documentation'!
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    26
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    27
copyright
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    28
"
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    29
 COPYRIGHT (c) 1991 by Claus Gittinger
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    30
	      All Rights Reserved
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    31
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    32
 This software is furnished under a license and may be used
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    33
 only in accordance with the terms of that license and with the
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    35
 be provided or otherwise made available to, or used by, any
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    36
 other person.  No title to or ownership of the software is
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    37
 hereby transferred.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    38
"
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    39
!
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    40
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    41
documentation
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    42
"
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    43
    Shows memory usage (oldspace + newspace). Simple, but useful.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    44
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    45
    The numbers shown are:
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    46
        tot     total memory usage (i.e. allocated oldSpace + allocated newSpace)
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    47
                (does not include the second semispace and other help-areas,
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    48
                 such as the remembered set etc.)
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    49
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    50
        all     current oldSpace in use + newSpace in use
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    51
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    52
        new     current newSpace in use
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    53
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    54
        frl     free space in (fragmented) free lists
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    55
        fre     compact free area above the used oldSpace
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    56
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    57
        old     current oldSpace in use
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    58
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
    59
        cod     dynamic compiled code space size (just in time compiler)
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
    60
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    61
        max,    extreme values of 'tot' since the monitor started
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    62
        min     (can be reset by typing 'r' in the view)
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    63
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
    64
        t       tenure threshold (1 .. 30)
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    65
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
    66
        I       incremental GC state (2 = idle)
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    67
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    68
        weak    number of weak objects
109
claus
parents: 108
diff changeset
    69
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    70
        rem     size of rememberedSet
108
claus
parents: 107
diff changeset
    71
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    72
        minsc:  percent of newspace remaining after scavenge (worst case)
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    73
                (i.e. the minimum %% of scavenged objects)
108
claus
parents: 107
diff changeset
    74
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    75
        count   number of scavenges since system started
108
claus
parents: 107
diff changeset
    76
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    77
        %       percentage of live objects in newSpace after last scavenge
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    78
                (i.e. this is the garbage vs. living objects ratio of
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    79
                 newSpace objects after the last scavenge)
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    80
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    81
    the graphic shows:
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
    82
        orange  newSpace used
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    83
        green   free memory in freeLists
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    84
        white   oldSpace used
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    85
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    86
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    87
    the popupMenu offers GC functions; keyboard options are:
512
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    88
        'f' -> faster; 's' -> slower; 'r' -> reset min/max
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    89
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    90
    [author:]
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    91
        Claus Gittinger
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    92
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    93
    [see also:]
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    94
        ObjectMemory
b576020aa9be documentation
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
    95
        MemoryUsageMonitor ProcessMonitor
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    96
"
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    97
! !
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
    98
798
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    99
!MemoryMonitor class methodsFor:'defaults'!
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   100
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   101
defaultExtent
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   102
    ^ (200 @ 320)
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   103
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   104
    "Modified: 24.8.1996 / 12:04:21 / cg"
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   105
!
19
4cde336c0794 Initial revision
claus
parents:
diff changeset
   106
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   107
defaultIcon
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   108
    |i|
19
4cde336c0794 Initial revision
claus
parents:
diff changeset
   109
93
claus
parents: 91
diff changeset
   110
    i := Image fromFile:'MemMonitor.xbm'.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   111
    i notNil ifTrue:[^ i].
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   112
    ^ super defaultIcon
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   113
!
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   114
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   115
defaultLabel
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   116
    ^ 'Memory Monitor'
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   117
! !
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   118
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   119
!MemoryMonitor class methodsFor:'startup'!
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   120
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   121
isVisualStartable
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   122
    "returns whether this application class can be started via #open
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   123
     (i.e. via a double click on the class in the browser)"
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   124
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   125
    ^ true
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   126
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   127
    "Created: / 15.7.1998 / 12:59:58 / cg"
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   128
! !
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   129
19
4cde336c0794 Initial revision
claus
parents:
diff changeset
   130
!MemoryMonitor methodsFor:'drawing'!
4cde336c0794 Initial revision
claus
parents:
diff changeset
   131
798
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   132
displayKilo:aNumber name:nm y:y
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   133
    |s|
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   134
1898
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   135
    aNumber >= (1024*1024*99) ifTrue:[
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   136
        s := nm , ((aNumber // (1024*1024)) printStringLeftPaddedTo:5) , 'M '.
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   137
    ] ifFalse:[
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   138
        s := nm , ((aNumber // 1024) printStringLeftPaddedTo:5) , 'k '.
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   139
    ].
798
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   140
    self displayOpaqueString:s x:0 y:y.
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   141
1898
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   142
    "Modified: / 23.9.1998 / 13:19:04 / cg"
798
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   143
!
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   144
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   145
redraw
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   146
    "redraw all"
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   147
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   148
    self clear.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   149
    self redrawX:0 y:0 width:width height:height
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   150
!
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   151
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   152
redrawX:x y:y width:w height:h
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   153
    "redraw data"
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   154
107
claus
parents: 105
diff changeset
   155
    |total oldSpaceUsed newSpaceUsed freeMem lx startIdx endIdx
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   156
     right|
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   157
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   158
    shown ifFalse:[^ self].
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   159
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   160
    right := x + w - 1.
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   161
    right >= org ifTrue:[
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   162
        lx := x.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   163
        lx < org ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   164
            lx := org
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   165
        ].
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   166
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   167
        total := ObjectMemory symSpaceSize 
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   168
                 + ObjectMemory oldSpaceSize 
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   169
                 + ObjectMemory newSpaceSize.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   170
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   171
        startIdx := (lx-org+1).
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   172
        startIdx < 1 ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   173
            startIdx := 1
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   174
        ].
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   175
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   176
        endIdx := right-org+1.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   177
        endIdx >= updateIndex ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   178
            endIdx := updateIndex-1.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   179
        ].
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   180
        dX := 0.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   181
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   182
        startIdx to:endIdx do:[:i |
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   183
            newSpaceUsed := newData at:i.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   184
            newSpaceUsed notNil ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   185
                oldSpaceUsed := oldData at:i.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   186
                freeMem := freeData at:i.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   187
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   188
                self updateLineX:lx - dX
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   189
                       total:total 
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   190
                       old:oldSpaceUsed 
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   191
                       new:newSpaceUsed 
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   192
                       free:freeMem.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   193
            ].
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   194
            lx := lx + 1
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   195
        ]
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   196
    ].
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   197
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   198
    x < org ifTrue:[
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   199
        "/ force redraw.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   200
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   201
        prevFree := prevFree2 := prevOld := prevTotal := nil.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   202
        prevMemUsed := prevCodeUsed := prevNumWeak := prevNumRem := nil.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   203
        prevNumLifoRem := prevTenureAge := prevIGCPhase := nil.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   204
        prevLastScavengeReclamation := prevMinScavengeReclamation := nil.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   205
        prevScavengeCount := nil.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   206
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   207
        self updateNumbers.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   208
    ]
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   209
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   210
    "Modified: / 14.7.1998 / 23:33:47 / cg"
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   211
!
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   212
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   213
updateDisplay
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   214
    "update picture; trigger next update"
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   215
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   216
    |total oldSpaceUsed newSpaceUsed freeMem oldSpaceSize
1012
e3793f355ffc new easier bitBlt (default is synchronous)
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
   217
     gWidth shift scaleChange margin|
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   218
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   219
    shown ifTrue:[
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   220
        drawLock wouldBlock ifFalse:[
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   221
            drawLock critical:[
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   222
                oldSpaceUsed := ObjectMemory oldSpaceUsed + ObjectMemory symSpaceUsed.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   223
                newSpaceUsed := ObjectMemory newSpaceUsed.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   224
                freeMem := ObjectMemory freeListSpace + (ObjectMemory oldSpaceSize - ObjectMemory oldSpaceUsed).
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   225
                oldSpaceSize := ObjectMemory oldSpaceSize + ObjectMemory symSpaceSize.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   226
                total := oldSpaceSize + ObjectMemory newSpaceSize.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   227
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   228
                scaleChange := false.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   229
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   230
                ((total - freeMem) < minTotal) ifTrue:[
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   231
                    minTotal := total - freeMem.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   232
                    scaleChange := true
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   233
                ].
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   234
                (total > maxTotal) ifTrue:[
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   235
                    maxTotal := total.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   236
                    scaleChange := true
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   237
                ].
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   238
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   239
                oldData at:updateIndex put:oldSpaceSize. "/ oldSpaceUsed.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   240
                newData at:updateIndex put:newSpaceUsed.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   241
                freeData at:updateIndex put:freeMem.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   242
                updateIndex := updateIndex + 1.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   243
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   244
                scaleChange ifTrue:[
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   245
                    scale := height asFloat / (maxTotal + 100000).
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   246
                    self redraw
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   247
                ].
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   248
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   249
                gWidth := width - org.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   250
                margin := 1.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   251
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   252
                ((updateIndex-1) >= (gWidth - margin)) ifTrue:[
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   253
        "on slow displays, use:"
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   254
        "/            shift := gWidth // 4.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   255
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   256
        "for smooth display, use:"
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   257
                    shift := 1.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   258
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   259
                    oldData replaceFrom:1 with:oldData startingAt:shift+1.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   260
                    newData replaceFrom:1 with:newData startingAt:shift+1.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   261
                    freeData replaceFrom:1 with:freeData startingAt:shift+1.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   262
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   263
                    updateIndex := updateIndex - shift.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   264
                    dX := dX + shift.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   265
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   266
                    "/ before copying, handle any outstanding exposes ...
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   267
                    self repairDamage.
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   268
                    "/ self catchExpose.
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   269
                    self copyFrom:self 
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   270
                                x:(org + shift) y:0
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   271
                              toX:org y:0
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   272
                            width:(gWidth - shift - margin)
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   273
                           height:height
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   274
                            async:false.
1012
e3793f355ffc new easier bitBlt (default is synchronous)
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
   275
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   276
                    self clearRectangleX:(width - margin - shift) y:0 
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   277
                                   width:shift height:height.
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   278
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   279
                    "/ self waitForExpose.
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   280
                ].
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   281
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   282
                self updateLineX:(updateIndex - 1 + org - 1)
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   283
                           total:total 
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   284
                           old:oldSpaceSize "/ oldSpaceUsed
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   285
                           new:newSpaceUsed 
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   286
                           free:freeMem.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   287
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   288
                self updateNumbers.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   289
                self flush.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   290
            ].
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   291
        ].
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   292
    ].
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   293
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   294
    updateBlock notNil ifTrue:[
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   295
        Processor addTimedBlock:updateBlock afterSeconds:updateInterval
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   296
    ].
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   297
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   298
    "Modified: / 5.8.1998 / 13:13:18 / cg"
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   299
!
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   300
109
claus
parents: 108
diff changeset
   301
updateLineX:x total:total old:oldSpaceSize new:newSpaceUsed free:freeMem
claus
parents: 108
diff changeset
   302
    |hNew hOld hFree y1 y2 y3|
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   303
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   304
    hNew := (newSpaceUsed * scale) asInteger.
109
claus
parents: 108
diff changeset
   305
    hOld := (oldSpaceSize * scale) // 2.
claus
parents: 108
diff changeset
   306
    hFree := (freeMem * scale) // 2.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   307
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   308
    y1 := height - 1.
109
claus
parents: 108
diff changeset
   309
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   310
    y2 := y1 - hOld.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   311
    self paint:oldColor.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   312
    self displayLineFromX:x y:y1 toX:x y:y2.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   313
109
claus
parents: 108
diff changeset
   314
    y3 := y1 - hFree.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   315
    self paint:freeColor.
109
claus
parents: 108
diff changeset
   316
    self displayLineFromX:x y:y1 toX:x y:y3.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   317
109
claus
parents: 108
diff changeset
   318
    y1 := y2 - hNew.
1992
89bde57ef1c8 Fix drawing if newspace is 0.
Stefan Vogel <sv@exept.de>
parents: 1898
diff changeset
   319
    y1 ~= y2 ifTrue:[
89bde57ef1c8 Fix drawing if newspace is 0.
Stefan Vogel <sv@exept.de>
parents: 1898
diff changeset
   320
       self paint:newColor.
89bde57ef1c8 Fix drawing if newspace is 0.
Stefan Vogel <sv@exept.de>
parents: 1898
diff changeset
   321
       self displayLineFromX:x y:y1 toX:x y:y2.
89bde57ef1c8 Fix drawing if newspace is 0.
Stefan Vogel <sv@exept.de>
parents: 1898
diff changeset
   322
    ]
89bde57ef1c8 Fix drawing if newspace is 0.
Stefan Vogel <sv@exept.de>
parents: 1898
diff changeset
   323
89bde57ef1c8 Fix drawing if newspace is 0.
Stefan Vogel <sv@exept.de>
parents: 1898
diff changeset
   324
    "Modified: / 29.1.1999 / 20:45:07 / stefan"
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   325
!
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   326
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   327
updateNumbers
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   328
    "redraw numbers.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   329
     The values shown are:
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   330
        max:    maximum memory used since monitor started
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   331
        min:    minimum memory used since monitor started
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   332
        tot:    total memory used (overall oldSpace + overall newSpace)
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   333
        all:    current memory in use (oldSpace + newSpace)
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   334
        new:    current newSpace in use
735
600fe3dab131 comment
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   335
        fre:    current size of freelist in oldSpace
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   336
        old:    current oldSpace in use
735
600fe3dab131 comment
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   337
        code:   current just-in-time compiled code cache size
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   338
        t:      current tenure age
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   339
        I:      IGC state
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   340
        weak:   number of weak arrays in the system
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   341
        rem     remembered set size
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   342
        lrem    lifo remembered set size
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   343
        minsc:  percent of newspace remaining after scavenge (worst case)
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   344
        irq:    max. interrupt delay
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   345
        count of scavenges / last scavenge survivor rate
156
e6a7f80e2a71 show irq latency
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   346
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   347
    "
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   348
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   349
    |oldSpaceSize newSpaceSize memUsed oldMemUsed newMemUsed freeMem free2 
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   350
     codeUsed numWeak numRem numLifoRem tenureAge igcPhase 
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   351
     minScavengeReclamation lastScavengeReclamation scavengeCount
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   352
     y half s fontHeight fontDescent total n|
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   353
91
claus
parents: 85
diff changeset
   354
    oldMemUsed := ObjectMemory oldSpaceUsed + ObjectMemory symSpaceUsed.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   355
    newMemUsed := ObjectMemory newSpaceUsed.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   356
    freeMem := ObjectMemory freeListSpace.
91
claus
parents: 85
diff changeset
   357
    oldSpaceSize := ObjectMemory oldSpaceSize + ObjectMemory symSpaceSize.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   358
    newSpaceSize := ObjectMemory newSpaceSize.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   359
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   360
    memUsed := oldMemUsed + newMemUsed "- freeMem".
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   361
    total := oldSpaceSize + newSpaceSize.
68
b70257a99e48 *** empty log message ***
claus
parents: 61
diff changeset
   362
    free2 := ObjectMemory freeSpace.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   363
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   364
    self paint:White on:Black.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   365
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   366
    fontDescent := font descent.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   367
    fontHeight := font height + fontDescent.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   368
    half := height // 2 + fontDescent.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   369
109
claus
parents: 108
diff changeset
   370
    y := half - (fontHeight * 5).
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   371
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   372
    total ~~ prevTotal ifTrue:[
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   373
        ((total - freeMem) < minTotal) ifTrue:[
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   374
            minTotal := total - freeMem.
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   375
        ].
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   376
        (total > maxTotal) ifTrue:[
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   377
            maxTotal := total.
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   378
        ].
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   379
798
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   380
        self displayKilo:maxTotal name:'max ' y:font ascent.
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   381
        self displayKilo:minTotal name:'min ' y:(height - font descent).
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   382
        self displayKilo:total    name:'tot ' y:y.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   383
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   384
        prevTotal := total.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   385
    ].
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   386
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   387
    y := y + fontHeight.
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   388
    memUsed ~~ prevMemUsed ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   389
        self displayKilo:memUsed name:'all ' y:y.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   390
        prevMemUsed := memUsed.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   391
    ].
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   392
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   393
    y := y + fontHeight.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   394
    self paint:newColor.
798
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   395
    self displayKilo:newMemUsed name:'new ' y:y.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   396
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   397
    y := y + fontHeight.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   398
    freeMem ~~ prevFree ifTrue:[
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   399
        self paint:freeColor.
798
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   400
        self displayKilo:freeMem name:'frl ' y:y.
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   401
        prevFree := freeMem.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   402
    ].
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   403
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   404
    y := y + fontHeight.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   405
    free2 ~~ prevFree2 ifTrue:[
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   406
        self paint:freeColor.
798
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   407
        self displayKilo:free2 name:'fre ' y:y.
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   408
        prevFree2 := free2.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   409
    ].
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   410
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   411
    y := y + fontHeight.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   412
    (oldMemUsed - freeMem) ~~ prevOld ifTrue:[
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   413
        self paint:oldColor.
798
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   414
        self displayKilo:(oldMemUsed - freeMem) name:'old ' y:y.
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   415
        prevOld := (oldMemUsed - freeMem).
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   416
    ].
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   417
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   418
    y := y + fontHeight.
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   419
    ObjectMemory supportsJustInTimeCompilation ifTrue:[
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   420
        codeUsed := ObjectMemory compiledCodeSpaceUsed.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   421
        prevCodeUsed ~~ codeUsed ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   422
            self paint:oldColor.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   423
            codeUsed > 9999 ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   424
                s := 'code ' , ((codeUsed // 1024) printStringLeftPaddedTo:4) , 'k'.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   425
            ] ifFalse:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   426
                s := 'code ' , (codeUsed printStringLeftPaddedTo:4) , ' '.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   427
            ].
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   428
            self displayOpaqueString:s x:0 y:y.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   429
            prevCodeUsed := codeUsed.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   430
        ]
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   431
    ].
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   432
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   433
    "
303
1d94813f1977 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 168
diff changeset
   434
     the following is internal - normally only interesting when debugging the VM
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   435
    "
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   436
    y := y + fontHeight.
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   437
    tenureAge := ObjectMemory tenureAge.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   438
    igcPhase := ObjectMemory incrementalGCPhase.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   439
    (prevTenureAge ~~ tenureAge
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   440
    or:[prevIGCPhase ~~ igcPhase]) ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   441
        self paint:oldColor.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   442
        s := 't:' , (tenureAge printStringLeftPaddedTo:2) , ' '.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   443
        s := s , ' I:' , (igcPhase printStringLeftPaddedTo:2) , ' '.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   444
        self displayOpaqueString:s x:0 y:y.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   445
        prevTenureAge := tenureAge.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   446
        prevIGCPhase := igcPhase.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   447
    ].
108
claus
parents: 107
diff changeset
   448
claus
parents: 107
diff changeset
   449
    y := y + fontHeight.
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   450
    numWeak := ObjectMemory numberOfWeakObjects.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   451
    prevNumWeak ~~ numWeak ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   452
        self paint:oldColor.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   453
        s := 'weak: ' , (numWeak printStringLeftPaddedTo:4).
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   454
        self displayOpaqueString:s x:0 y:y.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   455
        prevNumWeak := numWeak.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   456
    ].
109
claus
parents: 108
diff changeset
   457
claus
parents: 108
diff changeset
   458
    y := y + fontHeight.
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   459
    numRem := ObjectMemory rememberedSetSize.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   460
    prevNumRem ~~ numRem ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   461
        self paint:oldColor.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   462
        s := 'rem: ' , (numRem printStringLeftPaddedTo:5).
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   463
        self displayOpaqueString:s x:0 y:y.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   464
        prevNumRem := numRem.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   465
    ].
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   466
109
claus
parents: 108
diff changeset
   467
    y := y + fontHeight.
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   468
    numLifoRem := ObjectMemory lifoRememberedSetSize.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   469
    prevNumLifoRem ~~ numLifoRem ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   470
        self paint:oldColor.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   471
        s := 'lrem: ' , (numLifoRem printStringLeftPaddedTo:4 ifLarger:['****']).
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   472
        self displayOpaqueString:s x:0 y:y.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   473
        prevNumLifoRem := numLifoRem.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   474
    ].
109
claus
parents: 108
diff changeset
   475
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   476
"/ does no longer make sense to show ....
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   477
"/    y := y + fontHeight.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   478
"/    ObjectMemory runsSingleOldSpace ifTrue:[
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   479
"/        self displayOpaqueString:'single' x:0 y:(half + (fontHeight*4)).
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   480
"/    ].
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   481
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   482
    y := y + fontHeight.
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   483
    minScavengeReclamation := ObjectMemory minScavengeReclamation * 100 // ObjectMemory newSpaceSize.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   484
    prevMinScavengeReclamation ~~ minScavengeReclamation ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   485
        minScavengeReclamation := 100 - minScavengeReclamation asInteger.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   486
        s := 'minSc ', (minScavengeReclamation printStringLeftPaddedTo:3) , '%'.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   487
        self paint:oldColor.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   488
        self displayOpaqueString:s x:0 y:y.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   489
        prevMinScavengeReclamation := minScavengeReclamation.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   490
    ].
108
claus
parents: 107
diff changeset
   491
claus
parents: 107
diff changeset
   492
    y := y + fontHeight.
157
77f56399cc5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 156
diff changeset
   493
    n := ObjectMemory maxInterruptLatency.
156
e6a7f80e2a71 show irq latency
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   494
    n notNil ifTrue:[
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   495
        s := 'irq ', (n printStringLeftPaddedTo:3) , ' ms'.
156
e6a7f80e2a71 show irq latency
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   496
    ] ifFalse:[
696
b55f8705bb41 show memory use of dynamic code cache
Claus Gittinger <cg@exept.de>
parents: 517
diff changeset
   497
        s := ''
156
e6a7f80e2a71 show irq latency
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   498
    ].
e6a7f80e2a71 show irq latency
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   499
    self displayOpaqueString:s x:0 y:y.
e6a7f80e2a71 show irq latency
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   500
e6a7f80e2a71 show irq latency
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   501
    y := y + fontHeight.
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   502
    scavengeCount := ObjectMemory scavengeCount.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   503
    lastScavengeReclamation := ObjectMemory lastScavengeReclamation * 100 // ObjectMemory newSpaceSize.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   504
    (prevScavengeCount ~~ scavengeCount
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   505
    or:[prevLastScavengeReclamation ~~ lastScavengeReclamation]) ifTrue:[
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   506
        lastScavengeReclamation := 100 - lastScavengeReclamation asInteger.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   507
        s := (scavengeCount printStringLeftPaddedTo:6)
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   508
             , (lastScavengeReclamation printStringLeftPaddedTo:3) , '%'.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   509
        self displayOpaqueString:s x:0 y:y.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   510
        prevLastScavengeReclamation := lastScavengeReclamation.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   511
        prevScavengeCount := scavengeCount.
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   512
    ].
156
e6a7f80e2a71 show irq latency
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   513
1721
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   514
    "Created: / 7.11.1995 / 14:48:16 / cg"
4d19c61fa688 avoid generating garbage when updating the display
Claus Gittinger <cg@exept.de>
parents: 1619
diff changeset
   515
    "Modified: / 14.7.1998 / 23:35:53 / cg"
19
4cde336c0794 Initial revision
claus
parents:
diff changeset
   516
! !
4cde336c0794 Initial revision
claus
parents:
diff changeset
   517
4cde336c0794 Initial revision
claus
parents:
diff changeset
   518
!MemoryMonitor methodsFor:'events'!
4cde336c0794 Initial revision
claus
parents:
diff changeset
   519
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   520
keyPress:key x:x y:y
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   521
    key == $f ifTrue:[
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   522
	"faster"
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   523
	updateInterval := updateInterval / 2
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   524
    ].
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   525
    key == $s ifTrue:[
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   526
	"slower"
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   527
	updateInterval := updateInterval * 2
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   528
    ].
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   529
    key == $r ifTrue:[
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   530
	"reset max"
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   531
	maxTotal := prevTotal.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   532
	scale := height asFloat / (maxTotal + 100000).
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   533
	self resetStatisticValues.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   534
	self redraw.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   535
    ]
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   536
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   537
    "Modified: 7.11.1995 / 17:45:13 / cg"
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   538
!
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   539
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   540
sizeChanged:how
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   541
    |nn no nf delta oldSize newSize|
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   542
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   543
    super sizeChanged:how.
19
4cde336c0794 Initial revision
claus
parents:
diff changeset
   544
1875
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   545
    (width == 0 or:[height == 0]) ifTrue:[
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   546
        ^self
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   547
    ].
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   548
45
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   549
    oldSize := oldData size.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   550
    newSize := width-org+1.
6fe62433cfa3 *** empty log message ***
claus
parents: 45
diff changeset
   551
168
0ca5ca046b22 Redraw text on vertical window size changes.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   552
    (newSize ~~ oldSize) ifTrue:[
1875
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   553
        nn := Array new:newSize.
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   554
        no := Array new:newSize.
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   555
        nf := Array new:newSize.
45
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   556
1875
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   557
        (newSize > oldSize) ifTrue:[
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   558
            nn replaceFrom:1 to:oldSize with:newData.
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   559
            no replaceFrom:1 to:oldSize with:oldData.
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   560
            nf replaceFrom:1 to:oldSize with:freeData
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   561
        ] ifFalse:[
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   562
            delta := (oldSize - newSize).
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   563
            nn replaceFrom:1 with:newData startingAt:delta+1.
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   564
            no replaceFrom:1 with:oldData startingAt:delta+1.
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   565
            nf replaceFrom:1 with:freeData startingAt:delta+1.
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   566
            updateIndex > newSize ifTrue:[
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   567
                updateIndex := updateIndex - delta.
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   568
            ]
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   569
        ].
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   570
        newData := nn.
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   571
        oldData := no.
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   572
        freeData := nf.
168
0ca5ca046b22 Redraw text on vertical window size changes.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   573
1875
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   574
        scale := height asFloat / (maxTotal + 100000).
19
4cde336c0794 Initial revision
claus
parents:
diff changeset
   575
    ].
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   576
    self clear.
168
0ca5ca046b22 Redraw text on vertical window size changes.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   577
    self redraw.
1875
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   578
575272661fc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1810
diff changeset
   579
    "Modified: / 7.9.1998 / 21:41:13 / cg"
19
4cde336c0794 Initial revision
claus
parents:
diff changeset
   580
! !
45
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   581
2117
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   582
!MemoryMonitor methodsFor:'initialize / release'!
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   583
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   584
destroy
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   585
    updateBlock notNil ifTrue:[
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   586
	Processor removeTimedBlock:updateBlock.
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   587
    ] ifFalse:[
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   588
	myProcess terminate.
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   589
	myProcess := nil
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   590
    ].
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   591
    oldData := newData := freeData := nil.
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   592
    super destroy
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   593
!
45
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   594
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   595
initialize
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   596
    super initialize.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   597
994
1734123c7520 friendly semaphore names
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
   598
    drawLock := Semaphore forMutualExclusion name:'drawLock'.
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   599
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   600
    updateInterval := 0.5.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   601
    ProcessorScheduler isPureEventDriven ifTrue:[
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   602
        updateBlock := [self updateDisplay].
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   603
    ].
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   604
    oldData := Array new:1000.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   605
    newData := Array new:1000.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   606
    freeData := Array new:1000.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   607
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   608
    updateIndex := 1.
1756
3cf323b3b704 must change the font first, then ask for its width.
Claus Gittinger <cg@exept.de>
parents: 1721
diff changeset
   609
3cf323b3b704 must change the font first, then ask for its width.
Claus Gittinger <cg@exept.de>
parents: 1721
diff changeset
   610
    self font:((Font family:'courier' face:'medium' style:'roman' size:10) onDevice:device).
3cf323b3b704 must change the font first, then ask for its width.
Claus Gittinger <cg@exept.de>
parents: 1721
diff changeset
   611
    org := font widthOf:'max 99999k '.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   612
    level := 0.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   613
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   614
    maxTotal := minTotal := ObjectMemory oldSpaceSize 
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   615
                            + ObjectMemory symSpaceSize
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   616
                            + ObjectMemory newSpaceSize.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   617
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   618
    viewBackground := Black.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   619
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   620
    device hasColors ifTrue:[
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   621
        newColor := Color orange. "/ yellow.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   622
        freeColor := Color green.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   623
        oldColor := Color white.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   624
    ] ifFalse:[
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   625
        newColor := Color grey:67.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   626
        freeColor := Color grey:33.
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   627
        oldColor := Color white.
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   628
    ].
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   629
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   630
    self model:self.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   631
    self menu:#memoryMenu
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   632
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   633
    "
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   634
     MemoryMonitor open
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   635
    "
989
0f047353b974 need a lock while drawing
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   636
1756
3cf323b3b704 must change the font first, then ask for its width.
Claus Gittinger <cg@exept.de>
parents: 1721
diff changeset
   637
    "Modified: / 27.7.1998 / 19:57:07 / cg"
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   638
!
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   639
85
d9713a3ca092 *** empty log message ***
claus
parents: 79
diff changeset
   640
memoryMenu
1795
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   641
    <resource: #programMenu>
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   642
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   643
    |m items moreItems specialMenu|
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   644
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   645
    items := #(
1809
429042db0bb1 reorganized menu again
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   646
                    ('background collect now'       backgroundCollect)
429042db0bb1 reorganized menu again
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   647
                    ('hi prio incremental collect'  incrementalCollect)
429042db0bb1 reorganized menu again
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   648
                    ('-')
429042db0bb1 reorganized menu again
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   649
                    ('scavenge'                     scavenge)
429042db0bb1 reorganized menu again
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   650
                    ('tenure'                       tenure)
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   651
                    ('-')
1809
429042db0bb1 reorganized menu again
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   652
                    ('cleanup memory'               cleanupMemory)
429042db0bb1 reorganized menu again
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   653
                    ('flush method history'         cleanupMethodHistory)
429042db0bb1 reorganized menu again
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   654
                    ('unload autoloaded classes'    unloadAllAutoloadedClasses)
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   655
                    ('-')
1809
429042db0bb1 reorganized menu again
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   656
                    ('compress sources'             compressSources)
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   657
              ).
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   658
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   659
    ObjectMemory backgroundCollectorRunning ifFalse:[
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   660
        moreItems := #(
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   661
                    ('start background collector'   restartBackgroundCollector )
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   662
                 ) 
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   663
    ] ifTrue:[
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   664
        (ObjectMemory backgroundCollectProcess priorityRange notNil)
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   665
        ifTrue:[
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   666
            moreItems := #(
1810
7128a8eb7554 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1809
diff changeset
   667
                    ('stop background collector'             stopBackgroundCollector      )
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   668
                    ('background collect with fix priority'  backgroundCollectWithFixPrio )
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   669
                     ) 
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   670
        ] ifFalse:[
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   671
            moreItems := #(
1810
7128a8eb7554 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1809
diff changeset
   672
                    ('stop background collector'                stopBackgroundCollector      )
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   673
                    ('background collect with dynamic priority' backgroundCollectWithDynamicPrio )
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   674
                     ) 
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   675
        ].
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   676
    ].
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   677
    items := moreItems , items.
323
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   678
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   679
    specialMenu := PopUpMenu
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   680
                        itemList:items
1619
6e4b1930841a use new itemList message from PopUpMenu
Claus Gittinger <cg@exept.de>
parents: 1261
diff changeset
   681
                        resources:resources.
85
d9713a3ca092 *** empty log message ***
claus
parents: 79
diff changeset
   682
105
claus
parents: 93
diff changeset
   683
    device ctrlDown ifTrue:[
323
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   684
        ^ specialMenu
105
claus
parents: 93
diff changeset
   685
    ].
85
d9713a3ca092 *** empty log message ***
claus
parents: 79
diff changeset
   686
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   687
    items :=    #(
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   688
                    ('collect garbage'              garbageCollect                  )
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   689
                    ('collect garbage & symbols'    garbageCollectAndSymbols        )
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   690
                    ('collect garbage & compress'   compressingGarbageCollect       )
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   691
                    ('-')                                                           
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   692
                    ('reset statistic values'       resetStatisticValues            )
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   693
                    ('-')
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   694
                    ('others'                       otherMenu                       Ctrl)
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   695
                  ).
1206
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   696
1619
6e4b1930841a use new itemList message from PopUpMenu
Claus Gittinger <cg@exept.de>
parents: 1261
diff changeset
   697
    m := PopUpMenu itemList:items resources:resources.
323
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   698
    m subMenuAt:#otherMenu put:specialMenu.
1795
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   699
323
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   700
    ^ m
972
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   701
1810
7128a8eb7554 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1809
diff changeset
   702
    "Modified: / 5.8.1998 / 15:35:14 / cg"
85
d9713a3ca092 *** empty log message ***
claus
parents: 79
diff changeset
   703
!
d9713a3ca092 *** empty log message ***
claus
parents: 79
diff changeset
   704
45
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   705
realize
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   706
    super realize.
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   707
    updateBlock notNil ifTrue:[
1756
3cf323b3b704 must change the font first, then ask for its width.
Claus Gittinger <cg@exept.de>
parents: 1721
diff changeset
   708
        Processor addTimedBlock:updateBlock afterSeconds:updateInterval.
45
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   709
    ] ifFalse:[
1756
3cf323b3b704 must change the font first, then ask for its width.
Claus Gittinger <cg@exept.de>
parents: 1721
diff changeset
   710
        myProcess := [
1898
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   711
            self updateProcess
1756
3cf323b3b704 must change the font first, then ask for its width.
Claus Gittinger <cg@exept.de>
parents: 1721
diff changeset
   712
        ] forkAt:6.
3cf323b3b704 must change the font first, then ask for its width.
Claus Gittinger <cg@exept.de>
parents: 1721
diff changeset
   713
        myProcess name:'monitor [' , 
3cf323b3b704 must change the font first, then ask for its width.
Claus Gittinger <cg@exept.de>
parents: 1721
diff changeset
   714
                       Processor activeProcess id printString ,
3cf323b3b704 must change the font first, then ask for its width.
Claus Gittinger <cg@exept.de>
parents: 1721
diff changeset
   715
                       '] update'
45
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   716
    ].
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   717
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   718
    newColor := newColor on:device.
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   719
    freeColor := freeColor on:device.
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   720
    oldColor := oldColor on:device.
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   721
1898
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   722
    "Modified: / 23.9.1998 / 12:41:10 / cg"
1890
8690768a429b ignore styleChange
Claus Gittinger <cg@exept.de>
parents: 1875
diff changeset
   723
!
8690768a429b ignore styleChange
Claus Gittinger <cg@exept.de>
parents: 1875
diff changeset
   724
8690768a429b ignore styleChange
Claus Gittinger <cg@exept.de>
parents: 1875
diff changeset
   725
reinitStyle
8690768a429b ignore styleChange
Claus Gittinger <cg@exept.de>
parents: 1875
diff changeset
   726
    "ignore style changes"
8690768a429b ignore styleChange
Claus Gittinger <cg@exept.de>
parents: 1875
diff changeset
   727
8690768a429b ignore styleChange
Claus Gittinger <cg@exept.de>
parents: 1875
diff changeset
   728
    "Created: / 15.9.1998 / 15:22:46 / cg"
45
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   729
! !
950b84ba89e6 *** empty log message ***
claus
parents: 19
diff changeset
   730
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   731
!MemoryMonitor methodsFor:'menu functions'!
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   732
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   733
backgroundCollect
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   734
    "start a background (non disturbing) incremental GC. 
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   735
     Since the GC is performed at a low priority, it may not make progress if higher
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   736
     prio processes are running"
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   737
 
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   738
    [
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   739
	ObjectMemory incrementalGC
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   740
    ] forkAt:5 
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   741
!
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   742
1795
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   743
backgroundCollectWithDynamicPrio
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   744
    "setup the background collector to run at dynamic priority.
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   745
     This is a new experimental feature."
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   746
1796
32c7e361cce6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1795
diff changeset
   747
    Processor isTimeSlicing ifFalse:[
32c7e361cce6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1795
diff changeset
   748
        Processor startTimeSlicing.
32c7e361cce6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1795
diff changeset
   749
        Processor supportDynamicPriorities:true
32c7e361cce6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1795
diff changeset
   750
    ].
32c7e361cce6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1795
diff changeset
   751
1795
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   752
    ObjectMemory backgroundCollectProcess priorityRange:(5 to:9).
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   753
    ObjectMemory backgroundFinalizationProcess priorityRange:(5 to:9).
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   754
1796
32c7e361cce6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1795
diff changeset
   755
    "Modified: / 4.8.1998 / 02:16:02 / cg"
1795
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   756
!
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   757
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   758
backgroundCollectWithFixPrio
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   759
    "setup the background collector to run at a fix priority.
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   760
     This is the default."
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   761
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   762
    ObjectMemory backgroundCollectProcess priorityRange:nil.
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   763
    ObjectMemory backgroundFinalizationProcess priorityRange:nil.
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   764
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   765
    "Modified: / 4.8.1998 / 02:00:31 / cg"
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   766
!
8a1731490268 more menu functions for configuring the
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
   767
105
claus
parents: 93
diff changeset
   768
cleanupMemory
claus
parents: 93
diff changeset
   769
    "let all classes release unneeded, cached
claus
parents: 93
diff changeset
   770
     data ..."
claus
parents: 93
diff changeset
   771
469
3653317928e2 dont repeat coding in ObjectMemory ...
Claus Gittinger <cg@exept.de>
parents: 360
diff changeset
   772
    ObjectMemory performLowSpaceCleanup.
3653317928e2 dont repeat coding in ObjectMemory ...
Claus Gittinger <cg@exept.de>
parents: 360
diff changeset
   773
105
claus
parents: 93
diff changeset
   774
    "
claus
parents: 93
diff changeset
   775
     then, perform a GC (incl. symbol reclamation)
claus
parents: 93
diff changeset
   776
    "
claus
parents: 93
diff changeset
   777
    ObjectMemory reclaimSymbols.
claus
parents: 93
diff changeset
   778
    "
claus
parents: 93
diff changeset
   779
     finally, compress
claus
parents: 93
diff changeset
   780
    "
1205
0b60eda64a3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   781
    ObjectMemory tenure.
105
claus
parents: 93
diff changeset
   782
    ObjectMemory verboseGarbageCollect.
1205
0b60eda64a3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   783
0b60eda64a3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   784
    "Modified: 26.6.1997 / 17:12:53 / cg"
105
claus
parents: 93
diff changeset
   785
!
claus
parents: 93
diff changeset
   786
844
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   787
cleanupMethodHistory
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   788
    "release the oldMethod history"
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   789
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   790
    (self confirm:'This removes the previous method history,
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   791
which is kept for all changed methods in the system.
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   792
After that, the browsers cannot easily switch back to a methods
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   793
previous version.
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   794
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   795
However, this is normally not a problem, since
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   796
a methods previous code should still be accessable through
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   797
either the changes-file, the sourceCode repository or the classes original
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   798
source file.
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   799
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   800
cleanup now ?') ifTrue:[
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   801
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   802
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   803
        Class flushMethodHistory.
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   804
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   805
        "
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   806
         then, perform a GC (incl. symbol reclamation)
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   807
        "
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   808
        ObjectMemory reclaimSymbols.
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   809
        "
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   810
         finally, compress
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   811
        "
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   812
        ObjectMemory verboseGarbageCollect.
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   813
   ]
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   814
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   815
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   816
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   817
!
95fde6837db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   818
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   819
compressSources
323
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   820
    (self confirm:'This saves all in-memory source strings into a file
360
5347e1bfae74 box text in compressSources
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   821
and makes methods reference these (file-) strings,
5347e1bfae74 box text in compressSources
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   822
freeing all in-memory sources.
323
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   823
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   824
If that source file is ever lost or gets out of sync with
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   825
your system, those method sources are lost and the browser
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   826
will show garbage. 
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   827
However, you still have a change file as backup.
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   828
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   829
(Be especially careful, if you move images around:
360
5347e1bfae74 box text in compressSources
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   830
 the source file must then be the correct one for that image)
323
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   831
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   832
A compress is only useful, if you added many methods
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   833
and the systems response time suffers from paging.
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   834
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   835
Compress anyway ?') ifTrue:[
350
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   836
        windowGroup withWaitCursorDo:[
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   837
            Smalltalk compressSources.
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   838
            ObjectMemory markAndSweep
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   839
        ]
323
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   840
    ]
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   841
360
5347e1bfae74 box text in compressSources
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   842
    "Modified: 9.2.1996 / 18:17:22 / cg"
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   843
!
156
e6a7f80e2a71 show irq latency
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   844
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   845
compressingGarbageCollect
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   846
    "perform a blocking compressing garbage collect."
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   847
350
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   848
    windowGroup withWaitCursorDo:[
1261
f59a1039ae3c tenure in GC to break rememberedSet refs.
Claus Gittinger <cg@exept.de>
parents: 1206
diff changeset
   849
        ObjectMemory tenure.
350
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   850
        ObjectMemory verboseGarbageCollect
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   851
    ]
1261
f59a1039ae3c tenure in GC to break rememberedSet refs.
Claus Gittinger <cg@exept.de>
parents: 1206
diff changeset
   852
f59a1039ae3c tenure in GC to break rememberedSet refs.
Claus Gittinger <cg@exept.de>
parents: 1206
diff changeset
   853
    "Modified: 30.7.1997 / 21:19:47 / cg"
156
e6a7f80e2a71 show irq latency
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   854
!
e6a7f80e2a71 show irq latency
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   855
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   856
garbageCollect
159
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   857
    "perform a blocking (non compressing) garbage collect"
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   858
350
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   859
    windowGroup withWaitCursorDo:[
1261
f59a1039ae3c tenure in GC to break rememberedSet refs.
Claus Gittinger <cg@exept.de>
parents: 1206
diff changeset
   860
        ObjectMemory tenure.
350
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   861
        ObjectMemory markAndSweep
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   862
    ]
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   863
1261
f59a1039ae3c tenure in GC to break rememberedSet refs.
Claus Gittinger <cg@exept.de>
parents: 1206
diff changeset
   864
    "Modified: 30.7.1997 / 21:19:35 / cg"
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   865
!
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   866
105
claus
parents: 93
diff changeset
   867
garbageCollectAndSymbols
159
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   868
    "perform a blocking (non compressing) garbage collect
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   869
     and reclaim unreferenced symbols."
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   870
350
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   871
    windowGroup withWaitCursorDo:[
1261
f59a1039ae3c tenure in GC to break rememberedSet refs.
Claus Gittinger <cg@exept.de>
parents: 1206
diff changeset
   872
        ObjectMemory tenure.
350
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   873
        ObjectMemory reclaimSymbols
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   874
    ]
68c5fed6c9bc show waitCursor while collecting
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   875
1261
f59a1039ae3c tenure in GC to break rememberedSet refs.
Claus Gittinger <cg@exept.de>
parents: 1206
diff changeset
   876
    "Modified: 30.7.1997 / 21:19:41 / cg"
105
claus
parents: 93
diff changeset
   877
!
claus
parents: 93
diff changeset
   878
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   879
incrementalCollect
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   880
    "start an incremental GC which does not disturb too much, but is guaranteed to
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   881
     make progress.
323
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   882
     This is done by doing the IGC at a very high priority, but giving up the CPU after
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   883
     every step. Due to the long delays, this may take a while to finish.
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   884
     Notice, that this is different from doing a background collect: that one
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   885
     may not make any progress if higher prio processes are runnable."
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   886
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   887
    |done delay|
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   888
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   889
    [
323
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   890
        done := false.
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   891
        delay := Delay new.
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   892
        [done] whileFalse:[
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   893
            10 timesRepeat:[
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   894
                done ifFalse:[done := ObjectMemory gcStep].
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   895
            ].
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   896
            (delay delay:10) wait
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   897
        ]
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   898
    ] forkAt:Processor highestPriority
323
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   899
f443d7e5bab0 special menu published
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
   900
    "Modified: 23.12.1995 / 17:31:55 / cg"
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   901
!
159
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   902
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   903
resetStatisticValues 
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   904
    ObjectMemory resetMaxInterruptLatency.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   905
    ObjectMemory resetMinScavengeReclamation.
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   906
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   907
    "Created: 7.11.1995 / 17:44:59 / cg"
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   908
!
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   909
972
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   910
restartBackgroundCollector
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   911
    "(re)start a background (non disturbing) incremental GC. 
972
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   912
     Since the GC is performed at a low priority, it may not make progress if higher
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   913
     prio processes are running"
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   914
 
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   915
    ObjectMemory backgroundCollectorRunning
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   916
    ifFalse:[
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   917
        ObjectMemory startBackgroundCollectorAt:5.
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   918
        ObjectMemory startBackgroundFinalizationAt:5
972
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   919
    ]
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   920
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   921
    "Created: / 21.1.1997 / 00:09:30 / cg"
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   922
    "Modified: / 5.8.1998 / 14:30:17 / cg"
972
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   923
!
7f8884cb99e2 items renamed;
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   924
105
claus
parents: 93
diff changeset
   925
scavenge 
159
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   926
    "perform a blocking newspace garbage collect.
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   927
     (this is for debugging only - the system does this automatically)"
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   928
105
claus
parents: 93
diff changeset
   929
    ObjectMemory scavenge
claus
parents: 93
diff changeset
   930
!
claus
parents: 93
diff changeset
   931
1808
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   932
stopBackgroundCollector
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   933
    "stop the background (non disturbing) incremental GC. 
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   934
     We do not recommend this - but maybe useful for debugging and
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   935
     evaluating the programs behavior in heavy-load situations
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   936
     (background collector cannot keep up with the allocation rate)"
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   937
 
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   938
    ObjectMemory stopBackgroundCollector.
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   939
    ObjectMemory stopBackgroundFinalization
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   940
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   941
    "Created: / 5.8.1998 / 14:29:40 / cg"
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   942
!
a1aa484160ee reorganized menu (place less often used items in special menu);
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
   943
105
claus
parents: 93
diff changeset
   944
tenure 
159
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   945
    "empty the newSpace, by aging all new objects immediately and transfering them
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   946
     into oldSpace.
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   947
     (this is for debugging only - the system does this automatically)"
159f86b6395a comments added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   948
105
claus
parents: 93
diff changeset
   949
    ObjectMemory tenure
1206
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   950
!
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   951
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   952
unloadAllAutoloadedClasses
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   953
    "unload all classes which were autoloaded and have no instances"
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   954
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   955
    Autoload loadedClasses copy do:[:anAutoloadedClass |
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   956
        anAutoloadedClass hasInstances ifFalse:[
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   957
            anAutoloadedClass unload
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   958
        ]
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   959
    ].
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   960
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   961
    "Created: 27.6.1997 / 14:21:45 / cg"
e3894601c394 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1205
diff changeset
   962
    "Modified: 27.6.1997 / 14:22:47 / cg"
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   963
! !
105
claus
parents: 93
diff changeset
   964
1898
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   965
!MemoryMonitor methodsFor:'private'!
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   966
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   967
updateProcess
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   968
    [true] whileTrue:[
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   969
        Delay waitForSeconds:updateInterval.
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   970
        self updateDisplay
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   971
    ]
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   972
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   973
    "Modified: / 23.9.1998 / 12:40:31 / cg"
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   974
! !
770d056a1f44 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   975
798
5ef299968209 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   976
!MemoryMonitor class methodsFor:'documentation'!
85
d9713a3ca092 *** empty log message ***
claus
parents: 79
diff changeset
   977
311
c118ce1f8afd flush in subprocess
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   978
version
2117
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
   979
    ^ '$Header: /cvs/stx/stx/libtool/MemoryMonitor.st,v 1.61 1999-04-23 12:45:55 cg Exp $'
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   980
! !