There are three memory management models, MEM_FLAT
, MEM_PROTECTED
, and MEM_VIRTUAL
. The model used is determined by the settings of the VIRTUAL_ADDRESS_SPACE
and ON_DEMAND_PAGING
features. See MEM(5FEA) for more details.
MEM_FLAT
This memory management model provides simple memory allocation services. The kernel and all applications run in one unique unprotected address space.
MEM_PROTECTED
This memory management model is targeted at real-time applications able to benefit from the flexibility and protection offered by memory management units, address translation and separate address spaces. No swap or demand paging is provided. No mapper interface is provided. Accesses to programs and data stored on secondary devices must be done by application-specific file servers.
MEM_VIRTUAL
This memory management model supports full virtual memory with swapping in and out on secondary devices. It has been specifically designed to implement distributed UNIX subsystems on top of the kernel.
The VIRTUAL_ADDRESS_SPACE
feature enables separate virtual address space support using the MEM_PROTECTED
memory management model. If this feature is disabled all the actors and the operating system share one single, flat, address space. When this feature is enabled a separate virtual address space is created for each user actor.
The ON_DEMAND_PAGING
feature enables on demand memory allocation and paging using the MEM_VIRTUAL
model. ON_DEMAND_PAGING
is only available when the VIRTUAL_ADDRESS_SPACE
feature is enabled.
Normally when a demand is made for memory, the same amount of physical and virtual memory is allocated by the operating system. When the ON_DEMAND_PAGING
feature is enabled, virtual memory allocation of the user address space does not necessary mean that physical memory will be allocated. Instead, the operating system may allocate the corresponding amount of memory on a large swap disk partition. When this occurs, physical memory will be used as a cache for the swap partition.