Training
×

Memory Requirements

A memory pool has a minimum and a maximum size.
The initial pool for a process is created as a contiguous piece of memory with the specified minimum size. If the maximum size of the pool is larger than the minimum size, memory can be borrowed from the parent up to the maximum size. The borrowed memory need not be contiguous to the initial pool.
Borrowed memory is returned to the parent pool when the object is deleted, or when the process that is using the memory is deleted.
Memory pools allow control over resource allocation: where necessary guarantees can be given by setting the minimum high enough. Also the pool principle avoids memory leaks when a process terminates abnormally.
Apart from the memory pool, each RT process also has its own virtual space (details are given later in section memory). This space includes all allocated memory, plus mappings for shared and physical memory and guard pages (of size 4k) to protect against running off the end of an area.
To be able to understand the need for virtual space/VSEG, take two examples:
- App allocates 1000 blocks of 4K each; total physical memory for that is 4M; total virtual memory is 4M-(1000*4k)=8M
- App allocates 4 blocks of 1000K each; total physical is 4M; total virtual is 4M+16K (4*4k)