Memory Management

wRTOS allocates its memory requirements from local memory. The Subsystem, networking components, and each RTSS process have two memory allocation spaces (MSpaces): an internal MSpace used for internal subsystem objects and bookkeeping, and a configurable external MSpace used for explicit-process memory allocation. Within each allocation space, there is a local pool and a pool cache to fulfill various memory requests. The local pool is used to deterministically fulfill the memory request from pool cache or directly fulfill requests from the application when larger memory amounts are needed. The pool cache is used to speed up the allocation of small size requests. It acts as an allocation cache with a configurable granularity of memory blocks allocated from local pool.

You can allocate (reserve) an initial amount of memory in advance in the external allocation space of a process at its startup. Otherwise, memory will be allocated on the application’s first memory allocation call. An RTSS application that allocates memory from the local pool or pool cache will receive memory deterministically if the local pool has enough memory available. The local pool provides deterministic behavior for normally non-deterministic functions, as well as greater flexibility and functionality after a system crash (blue screen).

RELATED Topics: