Meaning
Runtime memory provisioning occurs through a method that distributes variable sized memory blocks to a program during execution from a shared region of system RAM. Software applications rely on dynamic heap allocation to request specific block sizes when the exact memory requirement cannot be predicted before compilation. This technique provides the flexibility to create and destroy data objects during the execution cycle.
Runtime Fragmentation
Memory request operations require a central manager to locate free segments in the system memory map. A request for dynamic heap allocation triggers a search through available fragments to find a block that matches the requested size. This search introduces variable execution time depending on the state of the heap.
Allocation Overhead
Embedded microcontrollers with limited resources face substantial overhead from the bookkeeping information required to track free and allocated memory regions. The headers and pointers associated with dynamic heap allocation consume valuable bytes that would otherwise be available for application data. Over time, repeated allocation and release of blocks can divide the memory into small, non-contiguous segments.
This fragmentation prevents the system from fulfilling a large allocation request even if the total amount of free memory remains adequate. Program execution then fails because the memory manager cannot locate a single contiguous block of the requested size.
Determinism Limit
Safety critical environments often restrict the use of runtime provisioning to prevent unpredictable out of memory states. When dynamic heap allocation is used in real time operating systems, the risk of non-deterministic timing can cause a task to miss its deadline. Systems must have sufficient physical RAM to absorb the fragmentation overhead during prolonged execution.