Dev & Engineering ✓ Microsoft · Official memory-leakdisposable-managementevent-listenerstypescriptdom-handlerslifecycle-managementtest-validation

Memory Leak Audit

Systematically find and fix listener, lifecycle, and disposable leaks in VS Code code.

FollowSkills review · FSRS-2.0
Not recommended
52/ 100 5-point scale 2.6 / 5
Trust17 / 25 · 3.4/5

The skill provides code-review guidance only and requests no credentials, network access, or elevated privileges. Its recommendations generally promote disposal and lifecycle isolation. It does not specify user confirmation, sensitive-data handling, rollback, or external-side-effect boundaries, and the cited PR claims are not directly verified in the supplied material, so points are deducted.

Reliability8 / 20 · 2.0/5

The six-step checklist, examples, and verification section are internally readable, and the repository shows related chat leak scripts and CI workflows. However, the skill does not define handling for abnormal input, ambiguous framework semantics, failed tests, or unavailable dependencies; several rules are absolute, and key paths were not statically reproducible, so the score remains below the static ceiling.

Adaptability10 / 15 · 3.3/5

Trigger scenarios are clear and cover listeners, lifecycle events, repeated calls, pooled objects, and tests. Non-fit cases, input/output format, audit boundaries, and semantic exceptions are not clearly defined. Chinese-language support is absent, but the core function does not depend entirely on unreachable overseas services, so only partial points are deducted.

Convention7 / 15 · 2.3/5

The document has useful progressive structure with usage conditions, ordered checks, examples, and a quick-reference table. Repository context supplies MIT licensing, version information, and official maintenance provenance. The skill lacks installation or dependency notes, named ownership, an update path, changelog, FAQ, and explicit known limitations, warranting a mid-level score.

Effectiveness6 / 15 · 2.0/5

The guidance can directly help a reviewer identify common disposable leaks and suggests concrete repair patterns such as MutableDisposable, Event.once, and DisposableStore. Repository context also exposes a chat memory-leak script and CI entry point. The skill does not define a standard review output or patch format, requires case-specific judgment, and has no statically verified representative outputs, so points are deducted.

Verifiability4 / 10 · 2.0/5

The skill names PRs, code patterns, and repository scripts, while the supplied workflow provides auditable CI definitions for chat memory-leak checks. It lacks committed tests mapped to the skill's six key paths, pinned supporting evidence, and independent reproduction; no execution was performed in this review, so verifiability is limited.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision 5b3e1be7be9e
Before you use it
  • Do not apply the absolute rules mechanically; verify object lifetime, event semantics, and ownership in the local context.
  • The cited PR validation claims were not independently verified from the supplied material and should not be treated as proven test results.
  • Listener-count checks and the chat leak script require the repository's actual environment, dependencies, and build conditions; static review is not execution.
  • The skill does not define an output format, failure diagnosis, or rollback procedure, leaving those responsibilities to the user.
See the full review method →

What it does & when to use it

This skill supports VS Code code review and fixes for memory leaks, with emphasis on event listeners, DOM handlers, lifecycle callbacks, and disposable ownership. Its six-step checklist covers DOM events, one-time events, repeated method calls, model lifetimes, pooled resources, and test validation. It focuses on addDisposableListener, Event.once, MutableDisposable, DisposableStore, and onWillDispose patterns. It is a good fit for leak-focused engineering work, although the source does not document a standalone installer or executable audit script.

It instructs an agent to inspect DOM event registration, one-time events, listeners created by repeatedly called methods, model-tied DisposableStores, disposal ownership for pooled objects, and disposable leak checks in test suites. It flags raw .onload, .onclick, addEventListener(), unsuitable this._register() usage, and missing model cleanup, then recommends the corresponding disposable patterns. After a fix, it can check listener counts before and after repeated operations, confirm that object counts stabilize, and, for chat-related leaks, run npm run perf:chat-leak --messages 20 --verbose.

  1. A developer reviews a search, toggle, or initialization method that may add another listener every time it runs.
  2. A developer investigates a reported DOM-handler or extension-icon leak where listener counts keep increasing.
  3. A developer implements onWillDispose or onDidClose lifecycle handling and needs resources to follow the model lifetime.
  4. A developer maintains list or tree pools and must scope each pooled item's listeners to that item rather than to the pool.
  5. A developer writes tests that create disposable objects and needs automatic suite-level leak validation.

Pros & cons

Pros
  • Provides an ordered six-step checklist covering DOM events, one-time events, repeated calls, model lifetimes, pooled resources, and tests.
  • Includes concrete bad-versus-good TypeScript examples.
  • Names specific patterns: addDisposableListener, Event.once, MutableDisposable, DisposableStore, and onWillDispose.
  • Defines post-fix checks for listener counts, object-count stabilization, and chat heap growth.
Limitations
  • The guidance is centered on VS Code-style disposables and event patterns; broader framework or runtime coverage is not evidenced.
  • It provides no standalone audit script, test suite, or report format; the agent performs the review using the instructions.
  • A standalone installation method is not documented.
  • Chat leak verification depends on npm and the separately referenced chat-perf skill, whose contents are not included here.

How to install

The skill is located at .github/skills/memory-leak-audit/SKILL.md in the microsoft/vscode repository. The source only identifies it as one of 61 bundled skills and does not document a standalone installation command or package; load this SKILL.md in an Agent Skills-compatible client. The repository as a whole is licensed under MIT.

How to use

In a review or repair task, ask: "Audit this code for memory leaks and disposable issues, especially event listeners, DOM handlers, repeated calls, model lifecycle, and test cleanup." Have the agent follow the six-step checklist and verify that listener and object counts remain stable after repeated operations. For a chat-specific check, request npm run perf:chat-leak --messages 20 --verbose; the skill notes that this uses the chat-perf skill.

FAQ

Does this skill scan an entire repository and produce a report automatically?
The source provides no scanning script or report format. It supplies review rules, code examples, and verification steps for an agent to apply.
What code is it intended for?
It explicitly targets code involving event listeners, DOM handlers, lifecycle callbacks, repeated method calls, model lifetimes, and disposable objects in VS Code.
Does using it require network access?
The SKILL.md does not require network access. It mentions npm run perf:chat-leak for chat verification, but does not state that this command needs a network connection.
Can it guarantee that a leak is fixed?
No. It prescribes listener, object-count, test, and optional chat checks, but provides no formal guarantee.

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