Flexible Memory Model Guide

Overview of the Symbian platform flexible memory model

Design

The flexible memory model implements the address space using these objects:

  • memory objects,

  • memory managers,

  • memory mappings, and

  • address space objects.

Memory Objects

A memory object abstracts physical memory. It represents storage for chunks, code and thread stacks. A memory object is implemented as an array of physical page addresses. Attributes such as 'cached', 'uncached', 'device' and 'strongly ordered' are common to all the memory in the object.

Memory Managers

A memory manager performs operations on memory objects such as allocating and freeing memory. Different types of memory have different kinds of memory manager, for instance paged and unpaged memory.

Memory Mappings

Memory mappings exist to map virtual memory on to physical memory. One or more memory mappings are associated with one or more memory objects and their managers. Permissions, sharing and pinning are implemented at the level of the memory mapping. Permissions include read/write permissions, user/supervisor permissions and execute/no-execute permissions.

Address Space Objects

Address space objects model the address space of a process, that is the virtual address region used by the process. An address space contains a list of memory mappings through which the corresponding physical memory is accessed.

Changes

Kernel developers need to know about certain differences between the flexible memory model and the multiple memory model which was used in previous versions of Symbian platform.

In the multiple memory model, memory was managed at the level of the chunk. Chunks were wrapped round page tables of 1Mb and permissions and sharing were properties of the chunk. Address space was partitioned into local, shareable and code memory and shared memory had to be reserved at this level (that is, in units of 1Mb).

The transition to the flexible memory model involved two important changes.

  • Two processes sharing the same chunk may use different virtual addresses to access it. Old code which assumes that a chunk has a single virtual address may need to be rewritten.

  • The kernel no longer creates chunks to store thread stacks and static data for each process.

In two other respects the multiple memory model and the flexible memory model are exactly the same:

  • Hardware chunks are addressed globally.

  • Shared chunks have fixed kernel addresses which are accessible in supervisor mode.