
Heaptrack
This walks Claude through using heaptrack, a low overhead heap profiler for Linux that's significantly faster than Valgrind massif (2-3x slowdown vs 20x). It covers recording allocation traces, interpreting heaptrack_print output to find leaks and hotspots, comparing memory usage between runs, and using the GUI for visualization. The workflow includes build setup with debug symbols, filtering options, and integration with Rust binaries using the system allocator. Reach for this when you need to find memory leaks or understand allocation patterns without the performance hit of heavier tools, though you'll need debug symbols for readable backtraces.
- skills.sh installs
- 676
- GitHub stars
- 279
- last updated
- Aug 21, 2026
Install
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill heaptrack --agent claude-codeInstalls into .claude/skills of the current project.
Files
heaptrack
Purpose
Guide agents through heaptrack for heap allocation profiling on Linux: recording allocation traces, analysing with heaptrack_print, identifying leaks and hotspots, and comparing runs.
Triggers
- "How do I find memory allocation hotspots in my C++ program?"
- "My program uses too much memory — how do I find where?"
- "How do I use heaptrack to detect memory leaks?"
- "What is heaptrack and how does it differ from Valgrind massif?"
- "How do I compare memory usage between two program versions?"
- "heaptrack_print output — how do I interpret it?"
Workflow
1. Installation
# Ubuntu/Debian
sudo apt-get install heaptrack heaptrack-gui
# Fedora
sudo dnf install heaptrack
# Arch
sudo pacman -S heaptrack
# Build from source
git clone https://github.com/KDE/heaptrack.git
cmake -S heaptrack -B heaptrack-build -DCMAKE_BUILD_TYPE=Release
cmake --build heaptrack-build -j$(nproc)
2. Basic usage
# Profile a program (generates heaptrack.<prog>.<pid>.zst)
heaptrack ./myapp arg1 arg2
# Attach to running process
heaptrack --pid 12345
# Analyse the trace file
heaptrack_print heaptrack.myapp.12345.zst
Sponsors
Details
- Repository
- github.com/mohitmishra786/low-level-dev-skills
- Category
- Debugging
- First seen
- Jun 3, 2026
More from mohitmishra786/low-level-dev-skills
All 54- Rust Profiling673
- Ebpf672
- Msvc Cl671
- Fuzzing670
- Binutils665
- Linkers Lto663
- Conan Vcpkg659
- Dynamic Linking650
- Rust Security624
- Rust Ffi613
- Rust Unsafe611
- Pgo610
- Interpreters609
- Cargo Workflows608
- Rust Sanitizers Miri604
- Meson603
- Cpp Modules597
- Rust Debugging597
- Hardware Counters590
- Debug Optimized Builds579
- Cpp Templates574
- Rustc Basics567
- Rust Cross565
- Wasm Emscripten559