Memory Allocation Overview
Threads must allocate additional memory to perform certain operations, such as object creation. RTX64 provides two methods for how memory is allocated:
- Windows memory– all memory requests are directed to Windows for completion. These requests are non-deterministic and are allocated from the Windows non-paged pool. This type of allocation is not available from an RTSS Shutdown Handler.
- Local memory pool – all memory requests are handled by RTX64 and are allocated from a local memory pool created during the start of the Real-time subsystem. These requests are deterministic as long as the local pool has enough memory to fulfill your request. This type of allocation is available from an RTSS Shutdown Handler.
The default behavior of the Real-time subsystem can be set to either method. You can override this default behavior when starting an RTSS process through the RtssRun utility or RtCreateProcess function. Developers can also request local memory no matter the default by using RtAllocatLocalMemory within their RTSS application.
NOTE: The RTX64 memory allocation routines always allocate memory that is locked. This eliminates any chance of latencies due to page faults