eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'MemoryMonitorView':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: MemoryMonitorView


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--View
               |
               +--MemoryMonitorView

Package:
stx:libtool
Category:
Monitors-ST/X
Version:
rev: 1.31 date: 2017/11/22 20:46:34
user: cg
file: MemoryMonitorView.st directory: libtool
module: stx stc-classLibrary: libtool
Author:
Claus Gittinger

Description:


Shows memory usage (oldspace + newspace). Simple, but useful.

The numbers shown are:
    tot     total memory usage (i.e. allocated oldSpace + allocated newSpace)
            (does not include the second semispace and other help-areas,
             such as the remembered set etc.)

    all     current oldSpace in use + newSpace in use

    new     current newSpace in use

    frl     free space in (fragmented) free lists
    fre     compact free area above the used oldSpace

    old     current oldSpace in use

    mal     memory used by malloc (netto)

    mto     total memory that has been reserved by the malloc subsystem
            (may contained mem that has been freed or not yet allocated)

    cod     dynamic compiled code space size (just in time compiler)

    max,    extreme values of 'tot' since the monitor started
    min     (can be reset by typing 'r' in the view)

    t       tenure threshold (1 .. 30)

    I       incremental GC state (2 = idle)

    weak    number of weak objects

    rem     size of rememberedSet

    minsc:  percent of newspace remaining after scavenge (worst case)
            (i.e. the minimum %% of scavenged objects)

    count   number of scavenges since system started

    %       percentage of live objects in newSpace after last scavenge
            (i.e. this is the garbage vs. living objects ratio of
             newSpace objects after the last scavenge)

the graphic shows:
    orange  newSpace used
    green   free memory in freeLists
    white   oldSpace used


the popupMenu offers GC functions; keyboard options are:
    'f' -> faster; 's' -> slower; 'r' -> reset min/max

Disclaimer:
    this was one of the first tools written for ST/X (around 1989/90);
    today, it would probably be written differently...
    


Related information:

    ObjectMemory
    MemoryMonitor
    MemoryUsageMonitor
    ProcessMonitor

Instance protocol:

drawing
o  displayKilo: aNumber name: nm y: y

o  initializeDrawAction
extracted into a separate block to avoid memory allocation in updateDisplay

o  redraw
redraw all

o  redrawX: x y: y width: w height: h
redraw data

o  updateDisplay
update picture; trigger next update

o  updateLineX: x total: total old: oldSpaceSize new: newSpaceUsed free: freeMem

o  updateNumbers
redraw numbers.
The values shown are:
max: maximum memory used since monitor started
min: minimum memory used since monitor started
tot: total memory used (overall oldSpace + overall newSpace)
all: current memory in use (oldSpace + newSpace)
new: current newSpace in use
fre: current size of freelist in oldSpace
old: current oldSpace in use
mal: net allocated by malloc
mto: brutto memory reserved by malloc
code: current just-in-time compiled code cache size
t: current tenure age
I: IGC state
weak: number of weak arrays in the system
rem remembered set size
lrem lifo remembered set size
minsc: percent of newspace remaining after scavenge (worst case)
irq: max. interrupt delay
count of scavenges / last scavenge survivor rate


events
o  keyPress: key x: x y: y
faster

o  sizeChanged: how
(comment from inherited method)
tell subviews that I changed size.
How is either #smaller, #larger or nil, and is used to control the order,
in which subviews are notified (possibly reducing redraw activity)

initialization & release
o  destroy

o  initialize
yellow.

o  realize
(comment from inherited method)
realize - make visible;
realizing is done very late (after layout is fixed) to avoid
visible rearranging of windows on the screen

o  reinitStyle
ignore style changes

menu functions
o  backgroundCollect
start a background (non disturbing) incremental GC.
Since the GC is performed at a low priority, it may not make progress if higher
prio processes are running

o  backgroundCollectWithDynamicPrio
setup the background collector to run at dynamic priority.
This is a new experimental feature.

o  backgroundCollectWithFixPrio
setup the background collector to run at a fix priority.
This is the default.

o  cleanupMemory
let all classes release unneeded, cached
data ...

o  cleanupMethodHistory
release the oldMethod history

o  collectGarbage
perform a blocking (non compressing) garbage collect

o  collectGarbageAndCompress
perform a blocking compressing garbage collect.

o  collectGarbageAndSymbols
perform a blocking (non compressing) garbage collect
and reclaim unreferenced symbols.

o  compressOldSpace
perform a blocking compress (only useful if freeList is not empty, after M&S)

o  compressSources

o  incrementalCollect
start an incremental GC which does not disturb too much, but is guaranteed to
make progress.
This is done by doing the IGC at a very high priority, but giving up the CPU after
every step. Due to the long delays, this may take a while to finish.
Notice, that this is different from doing a background collect: that one
may not make any progress if higher prio processes are runnable.

o  memoryMenu

o  resetStatisticValues

o  restartBackgroundCollector
(re)start a background (non disturbing) incremental GC.
Since the GC is performed at a low priority, it may not make progress if higher
prio processes are running

o  restartBackgroundFinalizer
(re)start a background (non disturbing) incremental finalizer process.

o  scavenge
perform a blocking newspace garbage collect.
(this is for debugging only - the system does this automatically)

o  stopBackgroundCollector
stop the background (non disturbing) incremental GC.
We do not recommend this - but maybe useful for debugging and
evaluating the programs behavior in heavy-load situations
(background collector cannot keep up with the allocation rate)

o  tenure
empty the newSpace, by aging all new objects immediately and transfering them
into oldSpace.
(this is for debugging only - the system does this automatically)

o  unloadAllAutoloadedClasses
unload all classes which were autoloaded and have no instances

private
o  updateProcess


Demonstration:


    MemoryMonitor open


    MemoryMonitorView open



ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Wed, 19 Sep 2018 03:40:13 GMT