memory-profiling

Diagnose Node.js memory leaks by analyzing V8 heap snapshots and retention chains.

4|1|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/lodekeeper/dotfiles --skill memory-profiling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-profiling
Source: https://github.com/lodekeeper/dotfiles/tree/main/skills/memory-profiling
Command: npx skills add https://github.com/lodekeeper/dotfiles --skill memory-profiling

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers identify and fix memory leaks in Node.js applications, preventing performance degradation and application crashes.

Core Features & Use Cases

  • Heap Snapshot Analysis: Compare memory snapshots over time to pinpoint memory growth.
  • Retention Chain Tracing: Identify the specific objects and code paths retaining unwanted memory.
  • Use Case: When a Node.js service shows increasing memory usage over time, use this Skill to capture heap snapshots before and after the growth period, then analyze the differences to find the source of the leak.

Quick Start

Analyze the memory difference between two heap snapshots using the provided script.

Frequently Asked Questions about memory-profiling

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

FAQPage Schema
How do I find a Node.js memory leak using heap snapshots?

To find a Node.js memory leak, capture V8 heap snapshots before and after memory growth, then use this Skill to diff them and trace object retention chains pinpointing the leak source.

What causes unexpected object retention in Node.js long after disconnect?

Unexpected object retention post-disconnect is typically caused by lingering references in long-lived infrastructure objects. This Skill traces the specific retention chains to identify exactly what is preventing garbage collection.

Can I analyze V8 heap snapshot differences for unbounded memory growth?

Yes, you can analyze V8 heap snapshot differences to address unbounded memory growth. The Skill provides custom scripts to compare snapshots and identify asymmetric counter divergence and retained objects.

What is the best way to debug increasing memory usage in a Node.js service?

The best way to debug increasing memory usage in a Node.js service is to capture heap snapshots over time and analyze the differences. This Skill automates that diffing and retainer identification process.

How do I identify which code paths are retaining unwanted memory in Node.js?

To identify code paths retaining unwanted memory, this Skill analyzes V8 heap snapshots and traces the object retention chains. It highlights the specific objects and references causing the memory leak.