Dynamic Memory Allocation and Fragmentation in C & C++
White Paper
ABSTRACT
In C and C++, it can be very convenient to allocate and de-allocate blocks of memory as and when needed. This is certainly standard practice in both languages and almost unavoidable in C++. However, the handling of such dynamic memory can be problematic and inefficient. For desktop applications, where memory is freely available,these difficulties can be ignored. For real-time embedded systems, ignoring the issues is not an option. Dynamic memory allocation tends to be non-deterministic; the time taken to allocate memory may not be predictable and the memory pool may become fragmented, resulting in unexpected allocation failures. In this paper the problems will be outlined in detail. Facilities in the Nucleus RTOS for handling dynamic memory are outlined and an approach to deterministic dynamic memory allocation detailed.
Related Resources
Nucleus ReadyStart™ for Freescale i.MX28 Evaluation...
Software EvaluationNucleus ReadyStart™ for Freescale i.MX28 Evaluation Software
Download our free evaluation package to explore the full functionality of the integrated development environment for the Nucleus RTOS for Freescale i.MX28 processors.
Nucleus ReadyStart™ for Texas Instruments AM3517...
Software EvaluationNucleus ReadyStart™ for Texas Instruments AM3517 Evaluation Software
Download our free evaluation package to explore the full functionality of the integrated development environment for the Nucleus RTOS for TI AM3517 processors.
Explore Hardware and Software strategies to design...
On-demand Web Seminar 21:32Explore Hardware and Software strategies to design Smart Energy Profile (SEP) 2.0 Compliant Embedded Devices
The Smart Energy Profile (SEP) 2.0 is quickly becoming the go-to standard for developing innovative connected products and services for the Smart Grid. Information flow between meters, smart appliances,...
TAGS: Low Power, Nucleus, Power Management, SEP, smart energy
