Agent skill · software engineering · chromedevtools

memory-leak-debugging

Diagnoses and resolves memory leaks in JavaScript/Node.js applications. Use when a user reports high memory usage, OOM errors, or wants to capture, compare, or inspect heap snapshots with Chrome DevTools MCP memory tools.

Why this skill is useful

Provides specific workflows and commands for diagnosing memory leaks in JavaScript/Node.js applications that the AI wouldn't reliably generate on its own.

What it needs

About 2k tokens when loaded. Last updated 2026-08-06. 48,655 stars on the source repository.

What this skill does

Memory Leak Debugging This skill provides expert guidance and workflows for finding, diagnosing, and fixing memory leaks in JavaScript and Node.js applications using Chrome DevTools MCP tools. Prerequisites Advanced memory debugging tools (compareheapsnapshots, getheapsnapshotdetails, etc.) are only available when the server is started with the --memoryDebugging flag. First check if these tools are available; if not, try to read the MCP configuration file to check if --memoryDebugging is enabled. Core Principles Prefer MCP memory tools: Do NOT attempt to read raw .heapsnapshot files directly, as they are extremely large and will consume too many tokens. Use the Chrome DevTools MCP heap snapshot tools to summarize, compare, and inspect snapshots. Isolate the Leak: Determine if the leak is in the browser (client-side) or Node.js (server-side). Common Culprits: Look for detached DOM nodes, unhandled closures, global variables, event listeners not being removed, and caches growing unbounded. Note: Detached DOM nodes are sometimes intentional caches; always ask the user before nulling them. Close Loaded Snapshots: Heap snapshots can be large. After completing an investigation, use closeheapsnapshot for each loaded snapshot to release memory held by the MCP server. Workflows 1. Capturing Snapshots When investigating a frontend web application memory leak, utilize the chrome-devtools-mcp tools to interact with the application and take snapshots. Use page-scoped tools like click, navigatepage, fill, etc. (specifying pageId) to manipulate the page into the desired state. Revert the page back to the original state after interactions to see if memory is released. Repeat the same user interactions 10 times to amplify the leak. Use takeheapsnapshot (with pageId) to save .heapsnapshot files to disk at baseline, target (after actions), and final (after reverting actions) states. 2. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills chromedevtools/memory-leak-debugging

View the source on GitHub

Browse the @skills marketplace