memory-leak-debugging

Diagnose JavaScript and Node.js memory leaks using Chrome DevTools MCP heap snapshot tools.

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/rithm84/Manor --skill memory-leak-debugging-rithm84
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-leak-debugging
Source: https://github.com/rithm84/Manor/tree/main/.agents/skills/browser-related/chrome-devtools-mcp/memory-leak-debugging
Command: npx skills add https://github.com/rithm84/Manor --skill memory-leak-debugging-rithm84

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? JavaScript and Node.js applications that grow in memory until they hit OOM errors are hard to debug because raw heap snapshots are too large to inspect directly. This Skill provides a structured workflow for capturing, comparing, and analyzing heap snapshots with Chrome DevTools MCP memory tools to pinpoint the exact objects and retaining paths causing leaks. ## Core Features & Use Cases - Snapshot Capture and Comparison: Take baseline, target, and final heap snapshots while interacting with a page, then diff them with compare_heapsnapshots to find growing object classes. - Retainer Inspection: Trace why suspicious objects stay reachable using retainer, retaining-path, dominator, and edge queries before changing any code. - Fallback Analysis: Use memlab or the included compare_snapshots.js Node.js script when built-in MCP tools are insufficient. - Use Case: A user reports that their React app's memory climbs after repeatedly opening and closing a modal. The Skill guides capturing snapshots around the interaction, identifying detached DOM nodes in the diff, and tracing the retaining event listener back to the component code. ## Quick Start Ask the agent to investigate high memory usage in your web app by capturing and comparing heap snapshots with Chrome DevTools MCP.

Frequently Asked Questions about memory-leak-debugging

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

FAQPage Schema
How do I find a memory leak in a JavaScript web application?

Capture three heap snapshots with Chrome DevTools MCP: a baseline, one after repeating the suspect action about 10 times, and one after reverting it. Then use compare_heapsnapshots to find growing object classes and inspect their retaining paths to locate the leak in your code.

How to compare two .heapsnapshot files?

Use the compare_heapsnapshots MCP tool for a summary diff, then drill into suspicious classes. As a fallback, run the included compare_snapshots.js script with Node.js, passing the baseline and target snapshot paths, to list the top growing objects and common leak types.

Can I read a .heapsnapshot file directly to analyze it?

No, raw .heapsnapshot files are extremely large and will exceed context limits. Always use Chrome DevTools MCP heap snapshot tools, memlab commands like find-leaks, or the provided comparison script instead of loading the raw file.

What are the most common causes of JavaScript memory leaks?

The most common causes are uncleared event listeners, detached DOM nodes still referenced by variables, unintentional global variables, closures capturing large objects, and unbounded caches or arrays. Note that detached DOM nodes are sometimes intentional caches, so confirm with the user before nulling them.

When should I use memlab instead of Chrome DevTools MCP memory tools?

Use memlab as a fallback when the built-in MCP memory tools are not enough for the investigation. Run npx memlab find-leaks with baseline, target, and final snapshots to get retainer traces for identified leaks.