What’s Eating my RAM? - C++ Memory Management
Talkat CppCon 2024 · on Tuesday, 2024-09-17· at 09:00· Spruce 3/4, 6700 North Gaylord Rockies Boulevard·
summary
Service raises a 90% memory alarm and investigation finds both leaks and fragmentation: a long‑running stateless process holds ~214 MB total with ~10 MB free but largest allocatable block only 63 KB (fragmentation ≈ 0.95), and one service grows ~400 MB/day versus a sibling that grows ~200 MB over seven days. Detection uses test allocator, address saser, and a VR tool set (massif/dhat style) to get callstacks, snapshots over time, and allocation‑access heatmaps; fixes remove leaks but fragmentation requires allocator or code‑locality changes.
AI-written summary · about
chapters (16)
- 0:00Memory management challenges
- 1:28Memory alarm urgency
- 3:40Memory usage and performance
- 5:03C++ to RAM basics
- 9:22malloc memory chunks
- 12:37Memory leaks identification
- 17:34Tools for leak detection
- 23:19Fixing leaks and growth
- 23:41Memory fragmentation issues
- 25:53Fragmentation formulas
- 28:23Analyzing fragmentation
- 30:53Evaluating fragmentation with Dhat
- 32:02Reducing fragmentation
- 34:15Code solutions for fragmentation
- 38:51Memory locality optimization
- 40:38Summary and recommendations
related talks
29mWrangling memory leaks where you thought they could never happen
37mTrack your memory allocation
57mDynamic memory allocation challenges in safety critical systems
32mThe Impact of Memory Allocators on Performance: A Deep Dive
01h 03mTaming dynamic memory
05mInterview
26mAllocating Less: Really Thin Rust Cloud Apps
38mEfficient On-Device Core Dump Processing for IoT: A Rusty Implementation
