Low-overhead memory allocation tracking
summary
Static code-tagging allocates per-callsite structs in a special ELF section and instruments slab and page allocators to increment/decrement counters, storing per-allocation pointers via page extension and slab object extensions. It adds optional context capture to record timestamps, PID and kernel call stacks for hot or leaking sites, and supports per-site fault injection and always-on latency stats (“traffic lights”). Overhead is boot-time/configurable, needs CONFIG_DEBUG_INFO for file:line, and enabling page extensions to track page allocations; proposal also reserves extra errno space for unique error codes.
AI-written summary · about
chapters (10)
- 0:00Introduction to code tagging
- 1:25Kernel static structure allocation
- 2:08Memory allocation tracking
- 4:40Context capture for leak detection
- 7:49Fault injection with allocation tagging
- 9:13Latency tracking for events
- 12:31Unique error codes per site
- 16:24Memory overhead and config options
- 21:46Dependency on page extensions
- 23:10Production kernel considerations
related talks
16mMemory Allocation Profiling upcoming features
01h 02mProfiling with Heaptrack and Hotspot on Embedded Linux
14mIchnaea: A Framework for Precise Tracking of Memory Objects
11mHeaptrack: A Heap Memory Profiler for Linux
05mSlab allocators
44mHands Off and Putting SLAB/SLUB Feng Shui in a Blackbox
19mLLFree: Scalable and Optionally-Persistent Page-Frame Allocation
30mProfiling CPU and Memory on Linux, with Opensource Graphical Tools
