---
title: "Heap Snapshot Analysis: review, setup & limitations · Undominated.ai"
canonical: https://undominated.ai/skills/microsoft-heap-snapshot-analysis/
description: "Investigates memory leaks from V8 heap snapshots: parsing multi-hundred-megabyte .heapsnapshot files, comparing before/after object deltas, and tracing retainer paths while skipping the weak edges and debugger artifacts that produce false suspects."
---

# Heap Snapshot Analysis: review, setup & limitations · Undominated.ai

> Investigates memory leaks from V8 heap snapshots: parsing multi-hundred-megabyte .heapsnapshot files, comparing before/after object deltas, and tracing retainer paths while skipping the weak edges and debugger artifacts that produce false suspects.

[← Explore all skills](/skills/)

WEB PERFORMANCE / Microsoft

# Heap Snapshot Analysis

Investigates memory leaks from V8 heap snapshots: parsing multi-hundred-megabyte .heapsnapshot files, comparing before/after object deltas, and tracing retainer paths while skipping the weak edges and debugger artifacts that produce false suspects.

 [See setup guidance ↓](#setup)[Original source ↗](https://github.com/microsoft/vscode/tree/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis)

SOURCE REVIEW

 Reviewed 2026-10-15
 Evidence 5 linked sources
 Publisher Microsoft
 Licence [MIT ↗](https://github.com/microsoft/vscode/blob/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/LICENSE.txt)
 Revision 3a7c8e0181ef
 [Read what was—and wasn’t—checked ↓](#review)

“Analyze V8 heap snapshots to investigate memory leaks and retention issues. Use when given .heapsnapshot files, asked to compare before/after snapshots, asked to find what retains objects, or investigating why objects survive GC. Provides snapshot parsing, comparison, retainer-path helpers, and scratchpad scripts.”

 [Microsoft · upstream description ↗](https://github.com/microsoft/vscode/blob/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis/SKILL.md) Our analysis follows below.

01 / THE REASONING

## Why this made the selection.

 - Bakes anti-bias discipline into the workflow: the analyst is told to start fresh and ignore prior investigation notes so stale suspects cannot steer the current analysis.
- Names the false retainers that waste whole investigations — DevTools debugger global handles, WeakMap backing arrays — and mandates skipping weak edges when tracing retention, which is the single most common heap-analysis error.
- The bundled helpers are sized to reality: Buffer-based extraction for snapshots above the JSON.parse string limit and a streaming path for files beyond Node’s roughly 2 GiB Buffer ceiling.

### A good fit for

 - Finding what retains disposed objects after a leak reproduction, via retainer-path analysis
- Comparing object counts and sizes between before/after snapshots from DevTools or the VS Code profiler
- Deciding whether a suspected leak is debugger-induced before spending a day on it
- Exclude weak edges when tracing retaining paths so WeakMap backing arrays are not treated as preventing collection.

### Weigh up before choosing

 - The retention-pattern catalogue (RowCache, HoverService, ObjectMutationLog) is VS Code-specific; the method transfers, the named suspects do not.
- Snapshots routinely exceed 500 MB and the workflow assumes Node with a raised heap and disk headroom for scratchpad scripts.
- Starts from snapshots that already exist; capturing them is delegated to a separate performance workflow skill.

02 / THE REVIEW RECORD

## What we actually inspected.

Source review has boundaries. A clear record is more useful than a “safe” badge.

### Material inspected

 - .github/skills/heap-snapshot-analysis/SKILL.md
- helpers and scratchpad directory listing
- LICENSE.txt

### Our findings

 - The helpers directory ships parseSnapshot and streamSnapshot modules matching the SKILL.md instructions, and the scratchpad directory exists for dated per-run findings.
- The edge table marks weak edges as skippable and explains why — WeakMap entries appear in retainer paths but do not prevent collection.
- The false-retainer section distinguishes debugger-induced retention from application-owned leaks before any fix is proposed, including the observability debug flag that retains all watched objects.

### Not established by this review

 - No .heapsnapshot file was parsed and no retainer path was traced; the helpers were inspected as listings, not executed.
- The VS Code retention patterns were not verified against the current source tree.
- Not executed: it was not installed or run.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

## Add a skill to your workflow.

[Upstream setup instructions ↗](https://github.com/vercel-labs/skills/blob/7407f3893ad4dceab546ac002c3ef806e4000c73/README.md)

DOCUMENTED COMMAND

 npx skills add microsoft/vscode/.github/skills/heap-snapshot-analysis --skill heap-snapshot-analysis Copy command ↗

Run in your terminal to choose your AI tools, project or global scope, and installation method. This short command follows the current upstream version; the review covers the revision shown above.

 Optional: install the reviewed revision

Keeps the original source and installer version where recorded, while leaving your AI tools and installation scope for you to choose.

 npx skills add https://github.com/microsoft/vscode/tree/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis --skill heap-snapshot-analysis Copy reviewed-revision command ↗ - Install the complete skill directory including the helpers and scratchpad layout; the SKILL.md alone cannot parse snapshots.
- Export before/after snapshots from DevTools or the VS Code profiler, then point the skill at them.

### Before you start

 - Node.js/npm for the installer and helper scripts
- An agent that supports the Agent Skills format
- Captured .heapsnapshot files and a leak scenario to investigate

### Compatibility

Agent Skills-compatible coding agents · Node.js with raised heap limits for the helper scripts · V8 .heapsnapshot files exported from DevTools or the VS Code profiler

### Reads heap snapshot files; writes scratchpad scripts and findings

 - Read .heapsnapshot files from the working directory
- Write and run Node.js scratchpad scripts with raised heap limits
- No network access is required by the workflow

### Cost model

MIT-licensed instruction package; analysis is local and costs only agent and machine time.

04 / FOLLOW THE EVIDENCE

## The source trail.

Our notes are separate from the original resource. Check upstream before adopting a new version.

 - [Skill definition at reviewed revision ↗](https://github.com/microsoft/vscode/blob/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis/SKILL.md) Checked 2026-10-07 https://github.com/microsoft/vscode/blob/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis/SKILL.md Supports: summary, upstreamDescription, whySelected, bestFor, limitations, review, access
- [Skill directory layout at reviewed revision (helpers and scratchpad present) ↗](https://github.com/microsoft/vscode/tree/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis) Checked 2026-10-07 https://github.com/microsoft/vscode/tree/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis Supports: review, install, limitations
- [Upstream license ↗](https://github.com/microsoft/vscode/blob/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/LICENSE.txt) Checked 2026-10-07 https://github.com/microsoft/vscode/blob/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/LICENSE.txt Supports: license
- [Skills installer source formats and selective installation ↗](https://github.com/vercel-labs/skills/blob/7407f3893ad4dceab546ac002c3ef806e4000c73/README.md) Checked 2026-10-07 https://github.com/vercel-labs/skills/blob/7407f3893ad4dceab546ac002c3ef806e4000c73/README.md Supports: install
- [Pinned source sections reviewed in continuation W48 on 2026-10-15 ↗](https://raw.githubusercontent.com/microsoft/vscode/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis/SKILL.md) Checked 2026-10-15 https://raw.githubusercontent.com/microsoft/vscode/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis/SKILL.md Supports: upstreamDescription, bestFor, review.reviewedAt, review.notTested

KEEP COMPARING

## Other approaches to consider.

Related by category or shared topics. These are alternatives to inspect, not a measured quality order.

 [### CPU Profile Analysis ↗ Walks an agent through analyzing V8 CPU profiles (.cpuprofile) and Chrome DevTools trace files: parsing large files safely, reconstructing call trees from sampling data, measuring self versus total time, and comparing code paths.](/skills/microsoft-cpu-profile-analysis/)[### Cloudflare Web Performance Audit ↗ Builds a performance review from browser traces, request details and relevant source instead of generic optimization advice.](/skills/cloudflare-web-perf/)[### Core Web Vitals ↗ Diagnoses LCP, INP and CLS from field evidence first — CrUX p75 with a labelled origin fallback, then a browser trace — and routes to per-metric references, with explicit rules against claiming field improvement from a lab run.](/skills/addyosmani-core-web-vitals/)

 [AI Tools ↗](/tools/)[Skills ↗](/skills/)[Agents ↗](/agents/)[MCP Servers ↗](/mcp-servers/)[Workflows ↗](/workflows/)

## Continue your investigation

 - [Choose a toolkit](/tools/)
- [Inspect execution hosts](/agents/)
- [Check tool access](/mcp-servers/)
- [Check project dependencies](/check-repo/)
