heaptrack

Profile heap allocations and identify memory leaks in Linux programs.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/awfixers-stuff/opencode-config --skill heaptrack-awfixers-stuff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: heaptrack
Source: https://github.com/awfixers-stuff/opencode-config/tree/main/skills/heaptrack
Command: npx skills add https://github.com/awfixers-stuff/opencode-config --skill heaptrack-awfixers-stuff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps developers and engineers locate where a program allocates and retains heap memory so they can find memory leaks, measure peak heap usage, and identify allocation hotspots that drive excessive memory consumption.

Core Features & Use Cases

  • Record live allocation traces for Linux binaries and attach to running processes to capture real-world behaviour.
  • Analyze traces with heaptrack_print and the GUI to surface peak heap consumption, leaked allocations, temporary allocation churn, and top call-stack hotspots.
  • Produce flamegraph-compatible folded stacks, compare baseline and new runs to highlight regression hotspots, and integrate with Rust by using the system allocator for interceptable allocations.

Quick Start

Run heaptrack on your binary to record a trace and then open the generated trace with heaptrack_print or heaptrack_gui to inspect top hotspots and leaks.

Frequently Asked Questions about heaptrack

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find memory leaks and allocation hotspots in a Linux C++ program?

Profile heap allocations by recording a trace with heaptrack on your Linux binary, then analyze the output to identify memory leaks and allocation hotspots. You can attach to running processes to capture real-world behavior.

Can I generate flamegraphs from heap allocation traces?

Yes, you can generate flamegraphs from heap allocation traces by producing flamegraph-compatible folded stacks. This visualizes temporary allocation churn and top call-stack hotspots to identify excessive memory consumption.

Does heaptrack work with Rust binaries for memory profiling?

Heaptrack supports Rust binaries for memory profiling by using the system allocator to ensure interceptable allocations. This allows you to record and analyze heap traces for Rust programs on Linux.

What is the best way to compare memory usage between two program runs?

Compare baseline and new runs by analyzing their recorded heap traces to highlight regression hotspots. This comparison reveals changes in peak heap consumption and leaked allocations between different executions.

How do I filter heaptrack output to show only memory leaks?

Analyze traces with heaptrack_print using leak-only views and minimum allocation thresholds to filter the output. This surfaces specific leaked allocations while hiding normal temporary allocation churn.

Do I need a specific environment to profile heap allocations with heaptrack?

You need a Linux environment to profile heap allocations with heaptrack, as it records live allocation traces for native C, C++, and Rust binaries. The tool produces summaries and hotspot lists for analysis.