Dev & Engineering ✓ Microsoft · Official heap-snapshot-analysisv8memory-leaksretainer-pathsgarbage-collectionnode.jstypescript

V8 Heap Snapshot Analyzer

Trace V8 heap retention paths to diagnose leaks and GC-surviving objects.

FollowSkills review · FSRS-2.0
Not recommended
40/ 100 5-point scale 2.0 / 5
Trust14 / 25 · 2.8/5

The skill mainly reads user-supplied heap snapshots and writes investigation scripts under a gitignored scratchpad; no credential theft, exfiltration, or destructive default is shown. However, it does not request confirmation of paths or disclose that heap snapshots may contain source code, prompts, or other sensitive data, and it lacks explicit permission boundaries, cleanup/rollback guidance, and dependency-integrity guidance, so points are deducted.

Reliability4 / 20 · 1.0/5

The workflow is coherent and includes a streaming alternative for large files and explicit weak-edge handling. Static review nevertheless finds that parseSnapshot.ts searches backward from only roughly the final 100 bytes for the strings-array key, which will generally fail to locate a large strings section, and scratchpad examples may use an incorrect ../helpers relative path. There are no skill-specific tests or strong diagnosable failure procedures, so the score remains low.

Adaptability8 / 15 · 2.7/5

The audience, input type, and main scenarios are reasonably clear, and the skill states a limitation for snapshots above 2 GiB. It does not define a standard output format, broader non-fit boundaries, exclusion triggers, or Chinese-language usage support. Its core function does not depend on overseas services, so no extra mainland-network deduction is applied.

Convention8 / 15 · 2.7/5

The documentation is layered across parsing, comparison, retainer tracing, and script authoring, with examples, limitations, concepts, and MIT copyright headers. It lacks a skill version, changelog, standalone installation/dependency notes, FAQ, explicit maintenance owner, and update path; the example import paths are also questionable, so points are deducted.

Effectiveness4 / 15 · 1.3/5

The intended comparison, graph, and retainer-path operations have clear practical value, and the skill offers a streaming strategy for very large snapshots. However, the apparent parser defect undermines reliable use, outputs are primarily console logs rather than a stable consumable format, and no representative results are statically verifiable, so only partial credit is justified.

Verifiability2 / 10 · 1.0/5

The source files, copyright notices, and repository CI are auditable, but the supplied CI workflows cover chat performance and leak checks rather than these helpers. There are no skill-specific tests, sample snapshots, or third-party execution artifacts; the assessment therefore rests mainly on static code inspection and receives low credit.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision 5b3e1be7be9e
Before you use it
  • The strings-section locator in parseSnapshot.ts may fail on ordinary or large snapshots; fix it and add sample-snapshot tests.
  • Relative imports from dated scratchpad subdirectories may need to be ../../helpers.
  • Heap snapshots may contain source code, prompts, object contents, and other sensitive data; authorization, storage, retention, and redaction requirements should be explicit.
  • Document a stable output format, failure behavior, version/changelog information, dependency setup, and maintenance/update path.
See the full review method →

What it does & when to use it

This Agent Skill analyzes V8 `.heapsnapshot` files for memory leaks, retention issues, before/after changes, and objects that survive garbage collection. It provides helpers for parsing snapshots, comparing them, and tracing retainer paths, plus guidance for investigation-specific scratchpad scripts. It starts with snapshots that already exist and does not capture them or drive VS Code scenarios. Snapshots larger than roughly 2 GiB may require streaming analysis instead of a full-file read.

Reads V8 .heapsnapshot files; uses parseSnapshot.ts and buildGraph to parse and model a snapshot; uses compareSnapshots.ts to compare before/after files and expose size, count, new-object-group, and summary results; uses findRetainers.ts to trace retainer paths while skipping weak edges; creates dated investigation scripts and findings.md files in .github/skills/heap-snapshot-analysis/scratchpad/; and uses streamSnapshot.mjs primitives for large-file section scanning, metadata parsing, chunked node and edge processing, and selective string resolution.

  1. A developer has before/after snapshots from DevTools or another workflow and needs to quantify object-count or size changes.
  2. An engineer needs to determine why a particular object class remains alive after garbage collection.
  3. A VS Code memory investigation needs to examine patterns such as RowCache templates, resource pools, observable closures, HoverService state, or serializer snapshots.
  4. A snapshot is larger than roughly 2 GiB and the analyst must scan only the relevant sections without materializing the whole file.
  5. An investigator needs one-off scripts and a dated record of hypotheses, rejected leads, measurements, and conclusions.

Pros & cons

Pros
  • Covers the main analysis stages: parsing, before/after comparison, and retainer-path tracing.
  • Explicitly instructs analysts to skip weak edges, reducing false leads from WeakRef and WeakMap relationships.
  • Includes a streaming approach for snapshots above roughly 2 GiB, including offset discovery, metadata-driven tuple widths, and chunked processing.
  • Documents several VS Code-specific retention patterns and defensive disposal practices.
  • Supports dated, gitignored scratchpad investigations with scripts, cached outputs, and findings documentation.
Limitations
  • It analyzes snapshots that already exist; it does not capture snapshots or reproduce interaction scenarios.
  • The regular helper may fail on files above roughly 2 GiB because of Node Buffer limits, requiring custom streaming analysis.
  • Streaming analysis requires investigation-specific choices about sections and fields, and field-level attribution can undercount listeners, watchers, and back-references.
  • The examples assume substantial Node.js heap allocation, including `--max-old-space-size=16384` or higher.
  • The source does not provide a standalone installation procedure, platform matrix, or test-suite information.

How to install

The Skill is located at .github/skills/heap-snapshot-analysis/SKILL.md in the microsoft/vscode repository. The source does not document a standalone installation command or separate package; place the directory containing this path where the chosen Agent Skills client can discover it. The repository is licensed under MIT.

How to use

Start with existing .heapsnapshot files and ask, for example: “Compare /path/to/before.heapsnapshot with /path/to/after.heapsnapshot, identify the largest new object groups, and trace retainer paths for ChatModel.” Investigation scripts can import parseSnapshot and buildGraph from ../helpers/parseSnapshot.ts, compareSnapshots from ../helpers/compareSnapshots.ts, or findRetainerPaths from ../helpers/findRetainers.ts. The source provides this execution form: cd .github/skills/heap-snapshot-analysis, then run node --max-old-space-size=16384 scratchpad/analyze.mjs; for very large files, write a streaming script using streamSnapshot.mjs. If the task also requires launching VS Code, driving a scenario, and capturing snapshots, use the VS Code performance workflow skill first.

Compared to similar skills

The VS Code performance workflow skill serves a different stage: it launches VS Code, drives a scenario, and captures snapshots, while this Skill performs low-level analysis on snapshots that already exist. They are complementary rather than interchangeable.

FAQ

Can this Skill capture heap snapshots automatically?
No. It begins with existing `.heapsnapshot` files. Use the VS Code performance workflow skill first when you need to launch VS Code, run a scenario, and capture snapshots.
How should I handle a snapshot larger than 2 GiB?
Use a streaming analysis script with `streamSnapshot.mjs`. The source recommends locating sections such as `nodes`, `edges`, and `strings`, then parsing only the required numeric arrays in chunks instead of retrying the same full-file read with a larger heap limit.
Are weak references treated as leak evidence?
Retainer-path tracing should skip `weak` edges because WeakRef and WeakMap keys do not prevent collection. WeakMap backing arrays can appear in paths but may be red herrings.
Does it require network access or an MCP server?
The source shows no network calls or MCP dependency. Analysis requires local snapshot files, the helper files in the Skill directory, and a Node.js runtime.

More skills from this repository

All from microsoft/vscode

Dev & Engineering ✓ Microsoft · Official

Tool Rename Compatibility Check

Protect existing prompts and tool configurations when built-in tools are renamed.

Dev & Engineering ✓ Microsoft · Official

Copilot Chat OpenTelemetry Instrumentation

A repository-specific guide for consistent OpenTelemetry instrumentation in Copilot Chat.

Dev & Engineering ✓ Microsoft · Official

VS Code Configuration Policy Maintainer

Standardize VS Code policy registration, export, and validation.

Design & Frontend ✓ Microsoft · Official

VS Code Design Philosophy

Turn vague UI discomfort into concrete fixes using shared values, principles, and design moves.

Dev & Engineering ✓ Microsoft · Official

Agent Host E2E Test Assistant

Maintain VS Code Agent Host end-to-end tests with strict replay fixtures.

Dev & Engineering ✓ Microsoft · Official

VS Code Integrated Browser Architecture

A practical architecture guide for safely changing VS Code's cross-process integrated browser.

Dev & Engineering ✓ Microsoft · Official

VS Code Agents Window Sessions

Safely implement and repair VS Code Agents window features.

Dev & Engineering ✓ Microsoft · Official

Commit Assistant

Creates repository-style commit messages and safely commits code changes.

Dev & Engineering ✓ Microsoft · Official

Agent Host Log Investigator

Trace session, transport, and host failures in Agent Host debug exports.

Dev & Engineering ✓ Microsoft · Official

VS Code Unit Test Runner

Run VS Code repository unit tests by file, test name, or compiled-output glob.

Dev & Engineering ✓ Microsoft · Official

VS Code Agent Customization Assistant

Create, repair, and troubleshoot VS Code Agent customization files and their loading behavior.

Dev & Engineering ✓ Microsoft · Official

Code OSS Launch & Debug

Launch a built-from-source VS Code with isolated profiles, Playwright control, and multi-process debugging ports.

Dev & Engineering ✓ Microsoft · Official

VS Code Accessibility Development Guide

A practical specification for accessible interactive features in VS Code.

Design & Frontend ✓ Microsoft · Official

VS Code CSS Layout Standards

Build reliable VS Code-style CSS layouts and text truncation behavior

Dev & Engineering ✓ Microsoft · Official

VS Code Chat Performance Lab

Benchmark chat rendering and detect memory growth across VS Code builds.

Dev & Engineering ✓ Microsoft · Official

Component Fixtures for Screenshot Testing

Create stable, theme-aware VS Code component fixtures for isolated screenshot testing.

Dev & Engineering ✓ Microsoft · Official

VS Code Smoke Test Assistant

Run, filter, and debug VS Code end-to-end smoke tests.

Dev & Engineering ✓ Microsoft · Official

VS Code Crash Dump Symbolicator

Turn native VS Code crash dumps into readable backtraces with method names.

Dev & Engineering ✓ Microsoft · Official

Local VS Code Web Workbench

Validate VS Code workbench and Agents window changes in a local vscode.dev instance.

Dev & Engineering ✓ Microsoft · Official

Feedback Action

Reads current-session feedback and applies the requested code changes.

Related skills