Memory Management
You can configure RTX64's default memory allocation behavior to use local memory or to request memory from Windows. Local memory is a pool of memory that can be configured to fulfill RTSS application memory requests. RTSS applications that allocate memory from the local pool will receive memory deterministically from the subsystem when the pool has the requested memory available. The local memory pool is created when the first RTSS application starts when the subsystem is set to use local memory by default, otherwise it is created on the first call to allocate memory from the local pool. It provides deterministic behavior for normally non-deterministic functions, as well as greater flexibility and functionality after a system crash (blue screen).
Use the Control Panel to select an option to configure default memory allocation behavior:
- Request from Windows (non-deterministic) configures all RTSS applications to request memory from Windows by default. RTX64 creates the local memory pool the first time someone uses RTSSrun with the /l flag or the first time they run an RTSS application that calls RtAllocateLocalMemory or RtAllocateLocalMemoryEx.
- Request from local memory pool (deterministic) configures all RTSS applications to request memory from the RTX64 local memory pool by default. RTX64 will create the local memory pool the first time an RTSS application is run.
You can configure RTX64 to automatically request additional memory (expand) from Windows once the local memory pool, defined by the Pool size value, is exhausted.
IMPORTANT! Expanding memory introduces non-deterministic behavior.
For more information, see Expanding and shrinking the local memory pool.
Important Considerations
- The RTX64 Subsystem uses the local memory pool, which requires additional memory for internal objects. This overhead is approximately 1KB per allocation. As a result, you cannot allocate the total amount of memory available. For example, if you have 1MB of contiguous memory, you would allocate only 1023KB to be sure the allocation succeeds.
-
The local memory pool can become fragmented if there are repeated calls to allocate and free chunks of memory. It is possible for the pool to have the amount of memory requested but not be able to allocate a block large enough to support that request.
- The initial memory pool configured through the Control Panel is allocated in the system only after a RTSS application is launched. If you need to allocate an important memory pool for your RTSS application(s), you must launch a RTSS application immediately after machine boot. When no RTSS is started, the local memory pool is not allocated.
- The longer the wait between machine boot and the time at which the first RTSS application is launched, the more the Windows memory becomes fragmented, especially by the Windows drivers. As a result, the contiguous memory area could become so fragmented that the RTX64 local memory pool cannot be allocated.
RELATED Topics: