Monthly E-letter

Latest edition | Subscribe

White Paper: Dynamic memory allocation and fragmentation in C & C++

White Paper: Dynamic memory allocation and fragmentation in C & C++

Full Text: Download PDF

Version: 1
Date File Uploaded: 2010-06-09
1In 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.
Silicon, software, and strategies for embedded devices
Embedded Computing Design magazine is the resource for engineers, architects, and decision makers involved with embedded devices. Topics explored span silicon, software, and strategies for designing and connecting with small devices in mobile, automotive, home, industrial, and medical applications. Departments include Deep Green discussing the latest in energy efficient, low power designs and applications. Content is available in print, E-letter, E-cast, white papers, video, RSS, social networks, and more. Subscriptions are free of charge.
©MMXEmbedded Computing Design.
An OpenSystems Media publication.