Memory accounting
Accounting for the memory used by your system and processes can be useful, especially when debugging. This section covers examples of how to read memory-related files and calculate reserved memory.
The actual calculations you perform will depend on your needs, and, due to the varying nature of different types of mapping, may be complex. The process counters discussed in this section provide a general value that represents reserved memory. To get an accurate value, you need to perform more complicated calculations using the raw information found in the memory manager.
Terminology
The following terminology is used for this discussion of memory accounting:
- Anonymous
- Used to refer to memory that is not associated with an explicit object. Anonymous memory can come from anywhere in RAM and is zero-initialized when allocated.
- Domain
- A collection of contiguous ranges of physical memory that serve a particular type of allocation (single page, multi-page, kernel).
- Map
- A structure that is used to construct the page table entry for each page in the address space.
- Page
-
A fixed-length contiguous block of memory. The QNX OS process manager allocates memory in pages (typically 4 KB each).
- Region
- A region is a sub-range of a process's address space. It is the result of a mmap() call. The pages in a region all share the same backing object, protection bits, and flags.