In this section we take a look at the primary system structures used in memory management and how they are located using the Dump Formatter and Kernel Debugger. These structures are:
The memory arena record (VMAR)
The memory arena header record (VMAH)
The examples worked in this section illustrate:
how to find all memory allocations made by a given process and what executable made the allocation.
how to determine ownership of non-system memory.
the use of memory objects, pseudo-objects and system objects.
Memory allocations have many attributes, included among which are:
data or content
location or address
size
ownership
requestor
The composite set of attributes associated with a memory allocation is refered to as a memory object. OS/2's virtal memory manager tracks memory objects using arena, object and context records.
We start by looking at the arena record, which is used to record virtual address assignements to memory objects.
The entire system address space of 4 gigabytes is partitioned into three types of memory arena:
System Arena
Global data
In general processes are not given automatic access to instance or global data. Access is granted either implicitly by the system loader because of calls to other DLLs or explicitly by use of the DosGiveXxxx and DosGetXxxx set of APIs.
There is just one shared arena, which reserves initially virtual memory addresses from 304Mb to 512Mb. This may be expanded by lowering the lower bondary. The current address range assigned to the shared arena is managed by a special arena record called the boundary sentinel arena record.
Private arenas are assigned an initial address range from 64k to 64M. This may be expanded upwards as more memory is allocated. The current size of a private arena is tracked by a special arena record called the sentinel arena record.
The private arena upper boundary and shared arena lower boundary may grow towards each other but not overlap.
These worked examples now follow: