Memory Allocation

15 October 2025 by Phillip JohnstonTable of Contents: Visualizing Memory Allocation Allocation Schemes Common System Policies Problems Arising from Dynamic Memory Allocation Runtime Problems Structural Problems Implementations References Visualizing Memory Allocation Here are some useful articles that explain how memory allocation typically works, including helpful diagrams and other visualizations. Visual overview of a custom malloc() implementation Memory Allocation, an article that includes a visual overview of how dynamic memory allocation works Allocation Schemes First-fit Free List Buddy Allocation Slab allocation Fixed-size block allocation (Memory pools) Intrusive containers (lists, maps, etc.) Individual elements put into the container store all the metadata …

To access this content, you must purchase a Membership - check out the different options here. If you're a member, log in.

foonathan/memory: Simplifying the C++ Memory Allocator

The memory library is developed by Jonathan Müller, a C++ library developer and author of foonathan::blog(). This library provides an new STL-compatible C++ memory allocator called RawAllocator. The RawAllocator is similar to the standard Allocator but is easier to use. The library also provides a BlockAllocator type which can be used for allocating large blocks …

Generating Aligned Memory

Embedded systems often have requirements for pointer alignment. These alignment requirements exist in many places, some including: General device/CPU requirements Unaligned access may generate a processor exception with registers that have strict alignment requirements Cache line size You don’t want to accidentally perform clean/invalidate operations on random data Peripheral hardware requirements DMA and USB peripherals …