memory-leak-audit

Detect memory leaks and disposable cleanup issues in VS Code extension code.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/aadorian/VSCode_Readme --skill memory-leak-audit-aadorian
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-leak-audit
Source: https://github.com/aadorian/VSCode_Readme/tree/main/education/engineering-tooling/github/copilot-skills/memory-leak-audit
Command: npx skills add https://github.com/aadorian/VSCode_Readme --skill memory-leak-audit-aadorian

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you find and fix memory leaks caused by forgotten disposables, lingering event listeners, and lifecycle cleanup mistakes in code reviews or bug investigations.

Core Features & Use Cases

  • Listener Audits: Review DOM handlers and event subscriptions to ensure they use tracked disposal patterns instead of raw assignments or unmanaged listeners.
  • Lifecycle Safety: Check one-time events, repeated method calls, and model-tied stores for cleanup patterns that prevent runaway registrations.
  • Test Protection: Verify test suites create and dispose objects safely so leaks are caught early with automated leak checks.
  • Use Case: A VS Code feature starts slowing down after repeated opens and closes; this Skill identifies the listener or disposable pattern that is accumulating over time.

Quick Start

Review this code for memory leaks and suggest the exact disposal or lifecycle fixes needed.

Frequently Asked Questions about memory-leak-audit

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

FAQPage Schema
How do I find memory leaks in VS Code extension development?

To find memory leaks in VS Code extension development, review event listeners and disposable cleanup patterns for unmanaged raw assignments. Verifying tracked disposal logic ensures lingering DOM handlers and forgotten disposables are caught before they accumulate and slow down features.

What causes memory leaks from event listeners and disposables in code?

Memory leaks from event listeners and disposables are caused by forgotten cleanup in lifecycle callbacks and unmanaged event subscriptions. When raw assignments bypass tracked disposal patterns, registrations accumulate over repeated method calls and model-scoped stores, ultimately degrading application performance.

How do I ensure safe disposable cleanup for one-time events?

To ensure safe disposable cleanup for one-time events, verify that patterns like Event.once and MutableDisposable are properly managed within a DisposableStore. Checking onWillDispose callbacks prevents runaway registrations and guarantees resources are released after execution.

Does this memory leak audit work for test suites and pooled objects?

Yes, this memory leak audit works for test suites and pooled objects by verifying the ensureNoDisposablesAreLeakedInTestSuite pattern. It checks that test suites safely create and dispose of objects, catching leaks early with automated checks before code is shipped.

What is the best way to audit DOM handlers for disposable cleanup issues?

The best way to audit DOM handlers for disposable cleanup issues is to review subscriptions for tracked disposal patterns instead of raw assignments. Using addDisposableListener ensures DOM handlers are properly tied to lifecycle callbacks and unregistered safely.

Why does my VS Code feature slow down after repeated opens and closes?

A VS Code feature slows down after repeated opens and closes due to memory leaks from lingering event listeners and forgotten disposables. Unmanaged listener registrations accumulate in model-scoped stores across lifecycle callbacks, consuming resources and degrading runtime performance.