heaptrack memory profiler skill for Linux. An agent skill from mohitmishra786/low-level-dev-skills.

MITAuto-check: notesDevelopment

Install Heaptrack

skills CLI
$ npx skills add mohitmishra786/low-level-dev-skills --skill heaptrack -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mohitmishra786/low-level-dev-skills heaptrack --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/profilers/heaptrack .claude/skills/heaptrack && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
heaptrack
GitHub stars
253
Token cost
~1.3k tokens
SKILL.md length
270 words
Files
2 (incl. references)
Skills in repo
138
Repo updated
First seen
Licence
MIT

At a glance

heaptrack memory profiler skill for Linux. An agent skill from mohitmishra786/low-level-dev-skills.

  • Works in 8 steps: Installation → Basic usage → Build for better profiling → …
  • Tracking heap allocations
  • SKILL.md covers Purpose, Triggers, Workflow and Related skills
  • Calls cmake, cargo and apt-get; reaches github.com

What it does

Heaptrack is an agent skill from mohitmishra786/low-level-dev-skills. heaptrack memory profiler skill for Linux. Use when tracking heap allocations, finding memory leaks, measuring peak heap usage, identifying allocation hotspots, or comparing allocation behaviour between runs. Activates on queries about heaptrack, heap profiling, memory allocation analysis, heaptrackprint, allocation hotspots, or memory leak detection with heaptrack.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/heaptrack-analysis.md`).

It sits in Development, covering Performance optimization. It works with Linux and Rust. The repository describes itself as: A curated suite of AI agent skills for systems and low-level programming with C/C++, Rust, and Zig toolchains, covering compilers, debuggers, profilers, build systems…. The licence is MIT.

When your agent uses it

  • Tracking heap allocations
  • Finding memory leaks
  • Measuring peak heap usage
  • Identifying allocation hotspots

Example prompts

  • “/heaptrack”

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Installation
  2. Basic usage
  3. Build for better profiling
  4. Interpreting heaptrack_print output
  5. Filtering and analysis options
  6. Comparing two runs
  7. heaptrack vs Valgrind massif
  8. Integration with Rust

What it can do on your machine

Read from SKILL.md and the folder at commit bdc5847. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cmake
    • cargo
    • apt-get
    • dnf
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Heaptrack loads about 1.3k tokens when it runs, and up to ~2.5k if it reads all its reference files. Until then it costs about 95 tokens; SKILL.md has 270 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~95
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteRuns commands with sudoSKILL.md:27
    sudo apt-get install heaptrack heaptrack-gui
  • NoteRuns commands with sudoSKILL.md:30
    sudo dnf install heaptrack
  • NoteRuns commands with sudoSKILL.md:33
    sudo pacman -S heaptrack

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mohitmishra786/low-level-dev-skills at commit bdc5847, republished under its MIT licence (© mohitmishra786). 270 words, ~1,307 tokens.

Download SKILL.mdSave it as .claude/skills/heaptrack/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
heaptrack
description
heaptrack memory profiler skill for Linux. Use when tracking heap allocations, finding memory leaks, measuring peak heap usage, identifying allocation hotspots, or comparing allocation behaviour between runs. Activates on queries about heaptrack, heap profiling, memory allocation analysis, heaptrack_print, allocation hotspots, or memory leak detection with heaptrack.

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
bash
# 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
bash
# 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

# GUI analysis (if heaptrack-gui installed)
heaptrack_gui heaptrack.myapp.12345.zst
3. Build for better profiling
bash
# Build with debug symbols (essential for readable backtraces)
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build

# Then profile
heaptrack ./build/myapp
4. Interpreting heaptrack_print output
bash
heaptrack_print heaptrack.myapp.*.zst 2>/dev/null

Key sections:

text
total runtime: 2.34s
calls to allocation functions: 145,234 (62,064/s)
temporary allocations: 89,123 (38,087/s)
peak heap memory consumption: 45.23MB
peak RSS (including heap): 78.45MB
total memory leaked: 2.34MB

# Top allocation hotspots (by peak memory)
hotspot 1: 12.34MB peak
  myapp::cache::Cache::insert(...)
    at src/cache.cpp:142
  ...

# Top leaked allocations
leak 1: 2.34MB leaked in 1,234 allocations
  myapp::connection::Connection::new(...)
    at src/connection.cpp:67
MetricMeaning
total memory leakedMemory allocated but never freed
peak heap consumptionMaximum live heap at any point
temporary allocationsAllocated and freed within one call stack
calls to allocation functionsTotal malloc/new/realloc calls
5. Filtering and analysis options
bash
# Show top N hotspots
heaptrack_print -p 10 heaptrack.myapp.*.zst  # top 10 hotspots

# Show flamegraph data
heaptrack_print -f heaptrack.myapp.*.zst > alloc.folded
flamegraph.pl alloc.folded > alloc.svg

# Show only leaked allocations
heaptrack_print -l heaptrack.myapp.*.zst

# Show allocations above threshold
heaptrack_print --min-cost 1048576 heaptrack.myapp.*.zst  # >1MB only

# Short summary
heaptrack_print -s heaptrack.myapp.*.zst
6. Comparing two runs
bash
# Record baseline
heaptrack ./myapp --config baseline.conf
mv heaptrack.myapp.*.zst before.zst

# Make changes, record again
heaptrack ./myapp --config new.conf
mv heaptrack.myapp.*.zst after.zst

# Compare (shows diff of hotspots)
heaptrack_print before.zst | head -20 > before.txt
heaptrack_print after.zst  | head -20 > after.txt
diff before.txt after.txt
7. heaptrack vs Valgrind massif
FeatureheaptrackValgrind massif
Overhead~2-3x~20x
OutputCompressed trace + GUIText/ms_print
Leak detectionYesYes
Peak trackingYesYes
Temporal viewYes (GUI)Yes (ms_print)
PlatformLinux onlyLinux, macOS
Needs recompileNoNo
Call graphFull stack tracesFull stack traces

Use heaptrack for most cases; use massif when you need platform portability or detailed snapshot comparison.

8. Integration with Rust

heaptrack works with Rust binaries when using the system allocator:

rust
// Rust: use system allocator so heaptrack can intercept
use std::alloc::System;
#[global_allocator]
static A: System = System;
bash
# Profile Rust binary
cargo build --release
heaptrack ./target/release/myapp

# Note: debug symbols improve backtraces
cargo build --profile release-with-debug
heaptrack ./target/release-with-debug/myapp

For heaptrack_print output reference and GUI usage, see references/heaptrack-analysis.md.

  • Use skills/profilers/valgrind for Memcheck (correctness) and massif (alternative heap profiler)
  • Use skills/profilers/linux-perf for CPU profiling alongside memory profiling
  • Use skills/rust/rust-profiling for Rust-specific allocation profiling approaches
  • Use skills/runtimes/sanitizers — ASan LeakSanitizer for leak detection without profiling overhead

© mohitmishra786, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/profilers/heaptrack of mohitmishra786/low-level-dev-skills.

  • SKILL.md
  • references/heaptrack-analysis.md

Open the folder on GitHubat commit bdc5847

Compare with similar skills

Heaptrack next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Heaptrack compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Heaptrack this skillmohitmishra786/low-level-dev-skills253—~1.3kAutomated safety check: NotesMIT
PlotJuggler 4 Perf ProfilingPlotJuggler/PlotJuggler6.2k—~1.6kAutomated safety check: NotesMPL-2.0
The Art of Debuggingstas00/the-art-of-debugging1.7k—~6.1kAutomated safety check: NotesCC-BY-SA-4.0
Samplyvortex-data/vortex3.2k—~2.7kAutomated safety check: PassApache-2.0
OpenLogi Device DiagnosisAprilNEA/OpenLogi23k—~1.6kAutomated safety check: PassApache-2.0
Investigate User Bugcristicretu/diri427—~1.2kAutomated safety check: PassApache-2.0

Similar skills

  • PlotJuggler 4 Perf Profiling

    PlotJuggler/PlotJuggler

    Guides CPU profiling of PlotJuggler 4 on Linux with perf: count first, record cheaply with LBR, then read per-thread, flat, flamegraph or time-window views.

    6.2k GitHub stars~1.6k tokensUpdated 8 days ago
    DevelopmentAuto-check: notes
  • The Art of Debugging

    stas00/the-art-of-debugging

    Condensed debugging method and tool recipes for Unix, Python and PyTorch programs: crashes, hangs, segfaults, wrong output, CUDA OOM, NaN values and slowness.

    1.7k GitHub stars~6.1k tokensUpdated 3 days ago
    DevelopmentAuto-check: notes
  • Samply

    vortex-data/vortex

    Analyze Samply Firefox-profiler output, record focused profiles, summarize hot threads/stacks, inspect symbolication, and compare profile evidence before and after a performance change.

    3.2k GitHub stars~2.7k tokensUpdated today
    DevelopmentAuto-check passed
  • OpenLogi Device Diagnosis

    AprilNEA/OpenLogi

    Finds the first failing layer when an OpenLogi Logitech device is missing or misbehaving across enumeration, open, probe, IPC and UI.

    23k GitHub stars~1.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Investigate User Bug

    cristicretu/diri

    Investigate a bug a specific diri user hit (crash, hang, slowness, memory leak, blank or garbled terminal, spawn/resume/remote failure, copy/paste not working) from diri's telemetry with the…

    427 GitHub stars~1.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Cpp

    crazyguitar/cppcheatsheet

    Comprehensive C/C++ programming reference covering everything from C11-C23 and C++11-C++23, system programming, CUDA GPU computing, debugging tools, Rust interop, and advanced topics.

    290 GitHub stars~1.8k tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from mohitmishra786/low-level-dev-skills

All 138 skills in this repo
  • ARM and AArch64 Assembly

    mohitmishra786/low-level-dev-skills

    Guides reading and writing AArch64 and ARM Thumb assembly: compiler output, inline asm, registers, the AAPCS calling convention and NEON or SVE basics.

    253 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • RISC-V Assembly Guide

    mohitmishra786/low-level-dev-skills

    Reference for RISC-V assembly on RV32 and RV64: register names and calling convention, extension naming, GCC and Clang inline asm, and QEMU with GDB debugging.

    253 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • x86-64 Assembly Reference

    mohitmishra786/low-level-dev-skills

    Explains x86-64 registers, the System V AMD64 calling convention, and how to read compiler-generated or inline assembly.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Bazel for C and C++

    mohitmishra786/low-level-dev-skills

    Guides your agent through Bazel for C/C++ projects: BUILD files, Bzlmod dependencies, toolchain registration, remote execution, dependency queries and sandbox debugging.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Binary Hardening

    mohitmishra786/low-level-dev-skills

    Binary hardening skill for security-hardened C/C++ builds. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed
  • Binutils

    mohitmishra786/low-level-dev-skills

    GNU binutils skill for binary manipulation and analysis. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Heaptrack

What does Heaptrack do?

heaptrack memory profiler skill for Linux. An agent skill from mohitmishra786/low-level-dev-skills. Heaptrack is an agent skill from mohitmishra786/low-level-dev-skills. heaptrack memory profiler skill for Linux.

When should I use Heaptrack?

Heaptrack fits situations like: tracking heap allocations; finding memory leaks; measuring peak heap usage; identifying allocation hotspots.

How do I install Heaptrack in Claude Code?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill heaptrack -a claude-code`. Or copy the skill folder (skills/profilers/heaptrack in mohitmishra786/low-level-dev-skills) into .claude/skills/heaptrack in your project. Claude Code loads it when a task matches its description.

How do I install Heaptrack in Codex?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill heaptrack -a codex`. Or copy the skill folder (skills/profilers/heaptrack in mohitmishra786/low-level-dev-skills) into .agents/skills/heaptrack in your project. Codex loads it when a task matches its description.

Can I use Heaptrack in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mohitmishra786/low-level-dev-skills --skill heaptrack -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/heaptrack, .gemini/skills/heaptrack, .github/skills/heaptrack and .opencode/skills/heaptrack in your project.

What does Heaptrack need to run?

Going by SKILL.md and its folder, Heaptrack needs the command-line tools its instructions call (cmake, cargo, apt-get, dnf and git).

Does Heaptrack access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Heaptrack safe to install?

Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Heaptrack use?

Heaptrack is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Heaptrack use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Heaptrack?

Skills that share tags, products or a category with Heaptrack: PlotJuggler 4 Perf Profiling (PlotJuggler/PlotJuggler, 6.2k stars), The Art of Debugging (stas00/the-art-of-debugging, 1.7k stars), Samply (vortex-data/vortex, 3.2k stars) and OpenLogi Device Diagnosis (AprilNEA/OpenLogi, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Heaptrack?

mohitmishra786 (a GitHub user) maintains it in mohitmishra786/low-level-dev-skills, which has 253 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on June 27, 2026.

Source: mohitmishra786/low-level-dev-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.