Available at: https://digitalcommons.calpoly.edu/theses/3099
Date of Award
6-2025
Degree Name
MS in Electrical Engineering
Department/Program
Electrical Engineering
College
College of Engineering
Advisor
Andrew Danowitz
Advisor Department
Electrical Engineering
Advisor College
College of Engineering
Abstract
The use of dynamic memory allocation presents a significant challenge for embedded systems, particularly in applications that require high reliability. The software controlling these systems needs to perform critical operations within strict timing constraints, and memory management plays a critical role in a system’s ability to meet these constraints. Dynamic memory allocation is inherently non-deterministic: if a task requests memory, it is impossible to predict how long it will take for the memory to be allocated. If a critical task were to rely on dynamically allocated memory, its execution could become stalled leading to a missed deadline and system failure.
Due to the non-deterministic behavior of dynamic memory allocation, safety-critical or mission-critical tasks typically rely on static memory allocation, which is fully deterministic and more reliable. Dynamic memory allocation on these systems is reserved for non-critical tasks where a delay in memory allocation will not result in system failure. This strategy allows a system to take advantage of the benefits of dynamic memory allocation (such as reduced memory footprint), while containing potential memory-related failures to non-critical tasks. However, even failures in non-critical tasks can degrade overall system performance. Additionally, since dynamic memory allocators access and modify system memory, there remain ways for the memory allocator to inadvertently disrupt the operation of critical tasks. Therefore, dynamic memory allocators for the applications need to be as fault-tolerant and memory-safe as possible.
This thesis researches and implements a fault-tolerant, multi-heap dynamic memory allocator for the FreeRTOS real-time operating system. This memory allocator provides FreeRTOS new fault-tolerant robustness by implementing support for multiple heaps, along with additional protections to improve memory safety and prevent unpredictable behavior. This memory allocator isolates processes from one another and ensures more predictable behavior than the existing FreeRTOS dynamic allocator.