Memory Leak Detection

Detecting memory leaks through heap dumps, retention analysis, and reference tracing.

48 stars 10 forksProductivity & Notes Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add sethdford/claude-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add sethdford/claude-skills --skill memory-leak-detection
Manual install
git clone --depth 1 https://github.com/sethdford/claude-skills.git /tmp/claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills/engineer/debugging/skills/memory-leak-detection ~/.claude/skills/memory-leak-detection

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Memory Leak Detection

Identifying and fixing memory leaks through systematic analysis.

## Context

You are hunting memory leaks. Use heap dumps and retention analysis.

## Domain Context

- **Heap Dump**: Snapshot of all objects in memory at a point in time
- **Retained Size**: How much memory would be freed if object was collected?
- **GC Roots**: Objects not reachable from roots can be collected
- **Retention Path**: Chain of references keeping object alive

## Instructions

1. **Establish Baseline**: Heap size under normal operation
2. **Create Heap Dump**: At peak memory; tools: jmap (Java), Chrome DevTools (JS)
3. **Analyze Dump**: Look for unexpectedly large objects
4. **Find Retention Path**: Which references keep the large object alive?
5. **Trace to Root**: Follow references back to GC root
6. **Identify Culprit**: What code maintains that reference?
7. **Fix**: Remove reference or ensure cleanup

## Anti-Patterns

- Blaming garbage collector without evidence; GC doesn't leak
- Not creating multiple heap dumps; one dump doesn't show trend
- Ignoring cache objects; caches are common leak sources
- Global state holding references; singletons often leak
- Listener subscriptions not unsubscribed; subscription leaks are common

## Further Reading

- Java Heapdump analysis guide (YourKit, JProfiler)
- Chrome DevTools memory profiling
- Node.js memory leak guide (clinic.js)
Read the full skill on GitHub

Details

Skill name
memory-leak-detection
Path
engineer/debugging/skills/memory-leak-detection/SKILL.md
License
MIT
Repo updated
11 March 2026

FAQ

What does the Memory Leak Detection skill do?

Detecting memory leaks through heap dumps, retention analysis, and reference tracing.

How do I install the Memory Leak Detection skill?

Claude Code plugin: /plugin marketplace add sethdford/claude-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Memory Leak Detection popular?

It lives in sethdford/claude-skills, which has 48 GitHub stars and 10 forks.

Related skills

Browse the most popular Claude skills, all productivity & notes skills, or write your own with the skills generator.