Skip to content

Linux heap profiler that records allocation traces, finds leaks, and compares memory use across runs.

CCM score
58 of 100
skills.sh installs
779
GitHub stars
303
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers recording with heaptrack and analysis with heaptrack_print or the GUI, including attaching to running processes via --pid
  • Includes filters such as -p, -l, -s, --min-cost, and flamegraph output with -f for hotspot and leak reports
  • Explains metrics like peak heap, temporary allocations, and total leaked memory, plus a comparison against Valgrind massif
  • Designed for C++ and Rust programs on Linux that need lower overhead (about 2-3x) than massif (about 20x)

Install

$ npx -y skills add mohitmishra786/low-level-dev-skills --skill heaptrack -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
Categories
Debugging, CLI & Terminal, Rust
First seen
Jun 3, 2026

Questions

What does the heaptrack skill help an agent do?

The heaptrack skill guides an agent through heap allocation profiling on Linux, covering recording allocation traces, analyzing them with heaptrack_print, finding memory leaks and allocation hotspots, and comparing runs. It also helps interpret heaptrack_print output such as peak heap consumption and total memory leaked.

How do I install the heaptrack skill?

Run npx -y skills add mohitmishra786/low-level-dev-skills --skill heaptrack -y in your project. Once installed, the agent can walk you through profiling programs with heaptrack and reading the resulting trace files.

Where does the heaptrack skill rank in the Debugging category?

The heaptrack skill is listed in the Debugging category on Claude Marketplaces, alongside diagnosing-bugs, azure-messaging, safe-debug, systematic-debugging and sentry-cli. It focuses specifically on memory allocation profiling rather than general bug diagnosis.

How does heaptrack compare to Valgrind massif according to this skill?

The skill notes that heaptrack has lower overhead, roughly 2-3x compared with about 20x for massif, and that it does not need recompilation. Massif remains the better choice when you need platform portability to macOS or detailed snapshot comparison.

Does the heaptrack skill work with Rust programs?

Yes, the skill covers using heaptrack with Rust binaries when the system allocator is used, so heaptrack can intercept allocations. It also recommends building with debug symbols for more readable backtraces.

More from mohitmishra786/low-level-dev-skills

All 54

Similar to Heaptrack

More Debugging