Explicit memory management
Explicit memory management is the practice of controlling the allocation and release of dynamically used memory through program code.
Refactoring to Rust
Manual memory management is a memory-management approach in which program developers explicitly control when memory is allocated and released.
- How it is used
- Contrasts developer-controlled cleanup with garbage collection when discussing memory-management approaches.
- How deep it goes
- Defines allocation and deallocation, explains stack and heap differences, and stops short of detailed implementation mechanics.
- Examples
- Uses a welcome program with explicit free operations to show where cleanup occurs.
- What you can do after
- Evaluate allocation choices by weighing memory use, allocation cost, and risks from insufficient memory.
Read how Refactoring to Rust explains explicit memory management →
Systems Programming with Zig
Manual memory management is the explicit allocation, ownership, and release of dynamically used memory by program code.
- How it is used
- Uses allocator selection to manage data lifetimes in a Zig FFI data representation.
- How deep it goes
- Explains shared arena lifetimes and shows initialization and arena cleanup in a data structure.
- Examples
- Uses a recipe book containing strings, a hash map, and an array list to illustrate allocator choices.
- What you can do after
- Evaluate/understand how allocator choices group data by lifetime while retaining programmer control.
Read how Systems Programming with Zig explains explicit memory management →
Also covered in
- .NET in Action, Second Edition
- JavaScript in DepthIn early access (MEAP)
- Server-Side WebAssembly
- Memory Safe C++In early access (MEAP)
- CUDA for LLMs
What to know first
- C++C++ is a statically typed, general-purpose programming language that supports procedural, object-oriented, generic, and low-level systems programming.
Related concepts
- C++used by · C++ is a statically typed, general-purpose programming language that supports procedural, object-oriented, generic, and low-level systems programming.
- garbage collectioncontrasts with · Garbage collection is an automated process that identifies and reclaims or removes memory, data, or other items no longer reachable or needed by a system.
- WebAssembly moduleused by · A WebAssembly module is a compiled, self-contained unit of WebAssembly code and associated definitions that a compatible host can instantiate and execute.
- memory layoutuses · Memory layout is the arrangement and mapping of data elements or regions to locations in memory.
- Arenaaddressed by · An arena allocator allocates objects from a shared memory region and reclaims that storage collectively rather than deallocating each object individually.
Questions about explicit memory management
What is explicit memory management?
Explicit memory management is the practice of controlling the allocation and release of dynamically used memory through program code.
Which Manning books explain explicit memory management?
Refactoring to Rust and Systems Programming with Zig.
What should I know before learning explicit memory management?
Manning books that teach explicit memory management usually introduce C++ first.
What is the difference between explicit memory management and garbage collection?
Explicit memory management is the practice of controlling the allocation and release of dynamically used memory through program code. Garbage collection is an automated process that identifies and reclaims or removes memory, data, or other items no longer reachable or needed by a system.
What is explicit memory management also called?
Explicit memory management is also called manual memory management.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

