The Heap Info Library gives the programmer access to information about the memory heaps of the program. BETA programs uses 3 different heaps:
- Infant-Object-Area (IOA): A dobbelt heap for newly instantiated object. Garbage collected using a stop-and-copy algorithm. When a object reachs a certain age is it copied to AOA.
- Adult-Object-Area (AOA): A large heap garbage collected using a freelist. This heap is also used for repetitions.
- CBFA (callbacks): A area used for callback structures.
The library defines two patterns, getHeapInfo and PrintHeapUsage.
PrintHeapUsage prints information on heap usage on standard output. It is used like this:
NAME 'MyProgram' |
INCLUDE '~beta/sysutils/heapinfo' |
PROGRAM: descriptor |
(#
do ...
'Heap Info at program point a'->PrintHeapUsage;
...
#)
|
getHeapInfo gives access to the individual data. The use is like this:
Program 2: Getting Heap Informations
(# ioasize:@integer;
do HeapInfoIOASize->getHeapInfo->ioasize;
'my IOA-size is %d\n'
->putformat(# do ioasize->d #);
#) |
The argument to getHeapInfo is predefined constants. getHeapInfo evaluates to an integer.
The library defines the following constants to be used with getHeapInfo:
- HeapInfoIOA
- HeapInfoIOALimit
- HeapInfoIOATop
- HeapInfoIOASize
- HeapInfoIOAActive
- HeapInfoIOAspace
- HeapInfoCBFA
- HeapInfoCBFALimit
- HeapInfoCBFATop
- HeapInfoCBFABlockSize
- HeapInfoCBFAsize
- HeapInfoAOABaseBlock
- HeapInfoAOATopBlock
- HeapInfoAOABlockSize
- HeapInfoAOATotalSize
- HeapInfoAOATotalFree
System Utilities - Reference Manual |
© 1994-2002 Mjølner Informatics |
[Modified: Friday September 29th 2000 at 23:36]
|