Most Malleable Memory Management Method in C++
summary
Shows runtime-swappable allocators and concrete wins: using polymorphic_allocator plus an unsynchronized_pool_resource on a word‑histogram drops allocations from ~133k to ~29k (over 4× reduction) as measured with Heaptrack and flame graphs. Provides a tracing memory_resource example and a PMR‑aware counted_string implementation that needs allocator‑last and copy/move‑with‑allocator constructors. Warns about forgetting to pass resources (defaults to new/delete), per‑object allocator pointer overhead, and that allocators never change on move assignment.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:46Memory management in C++
- 4:21PMR allocators basics
- 9:06Tracing memory resource demo
- 13:43Heap Track allocations
- 17:28Histogram with PMR
- 20:43Different memory resources
- 26:02Optimizing histogram with PMR
- 31:30PMR-compatible custom types
- 36:16Debugging PMR types
- 40:12PMR allocators pros and cons
- 46:37PMR design decisions
- 48:25Further learning
related talks
01h 03mMost Malleable Memory Management Method
01h 25mTaming Dynamic Memory - An Introduction to Custom Allocators
01h 01mGetting Allocators out of Our Way
06mLightning Talk: Speeding up code with C++17 Polymorphic Memory Resources
01h 01mAllocators: The Good Parts
01h 01mRecipes for Reducing Allocations by C++ Containers
57m“An allocator model for std2”
01h 11mDynamic Memory Allocation Challenges in C++ Safety Critical Systems
