heap-snapshot-analysis

Analyze V8 heap snapshots to trace retainer paths and compare before-and-after captures.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/THRISHAL12345/Project_X --skill heap-snapshot-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: heap-snapshot-analysis
Source: https://github.com/THRISHAL12345/Project_X/tree/main/apps/vscode-fork/.github/skills/heap-snapshot-analysis
Command: npx skills add https://github.com/THRISHAL12345/Project_X --skill heap-snapshot-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you investigate memory leaks and retention issues by analyzing V8 heap snapshots, so you can understand why objects survive garbage collection and what is keeping them alive.

Core Features & Use Cases

  • Snapshot parsing: Loads large .heapsnapshot files and extracts nodes, edges, strings, and metadata for analysis.
  • Before/after comparison: Diffs two snapshots to identify object groups that grew in size or count after a change.
  • Retainer-path tracing: Follows non-weak references back to GC roots to reveal the objects and closures preventing collection.
  • Use case: Compare a snapshot taken before a feature runs with one taken after repeated use to pinpoint the class or cache responsible for retained memory.

Quick Start

Analyze the provided heap snapshot files to find the objects most responsible for retained memory and explain the retainer paths keeping them alive.

Frequently Asked Questions about heap-snapshot-analysis

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

FAQPage Schema
How do I find memory leaks in V8 heap snapshots?

You can find memory leaks in V8 heap snapshots by parsing large `.heapsnapshot` files and diffing before-and-after captures to identify object groups that grew in size or count after a change.

Why do objects survive garbage collection in JavaScript applications?

Objects survive garbage collection because non-weak retainer paths keep them alive. Tracing these references back to GC roots reveals the specific closures and caches preventing collection.

How do I compare two heap snapshots to identify retained memory?

Compare two heap snapshots by diffing node counts and self sizes between before-and-after captures. This identifies which constructor groups grew and pinpoints the classes responsible for retained memory.

Can I analyze disposed instances and cache buildup in VS Code-based applications?

Yes, you can analyze disposed instances, cache buildup, and closure retention in VS Code-based applications by loading V8 heap snapshots and tracing non-weak retainer paths back to GC roots.

What is the best way to trace retainer paths in a heap snapshot?

The best way to trace retainer paths is to follow non-weak references back to GC roots from retained objects. This reveals exactly which objects and closures are preventing garbage collection.

Does heap snapshot analysis work with large .heapsnapshot files?

Yes, heap snapshot analysis works with large `.heapsnapshot` files by extracting nodes, edges, strings, and metadata for constructor grouping and comparison of node counts and self sizes.