memory-leak-audit

Audit code for memory leaks from unsafe listener and disposable lifecycle patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers catch and fix memory leaks caused by lingering event listeners, disposable objects, and lifecycle mismanagement in VS Code-style codebases.

Core Features & Use Cases

  • Listener Audits: Detect unsafe DOM handlers and replace them with tracked disposable listeners.
  • Lifecycle Safety: Apply the correct patterns for one-time events, repeated method calls, model disposal, and pooled objects.
  • Test Leak Validation: Ensure test suites actively check for leaked disposables so regressions are caught early.
  • Use Case: Review a feature that opens and closes repeatedly, confirm every subscription is cleaned up, and prevent listener counts from growing over time.

Quick Start

Use the memory-leak-audit skill to review this code path for disposable misuse and recommend the correct cleanup pattern.

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 caused by event listeners in a VS Code extension?

To find memory leaks in a VS Code extension, audit unsafe listener registrations and verify the use of tracked disposable patterns like addDisposableListener and DisposableStore. This identifies lingering DOM handlers that prevent proper resource cleanup.

What is the correct disposable lifecycle pattern for one-time events in Electron codebases?

The correct disposable lifecycle pattern for one-time events involves using Event.once and MutableDisposable. This ensures that subscriptions are automatically cleaned up after a single execution, preventing listener counts from growing over time.

How do I audit disposable misuse for model-bound resources and pooled objects?

To audit disposable misuse for model-bound resources and pooled objects, review code paths for correct disposal lifecycle patterns. Verify that repeated method calls and pooled objects properly track and dispose of resources to prevent accumulation.

How do I ensure test suites catch leaked disposables in VS Code development?

To ensure test suites catch leaked disposables in VS Code development, apply the ensureNoDisposablesAreLeakedInTestSuite pattern. This validates that every test actively checks for leaked resources, catching lifecycle regressions early.

Does this memory leak audit work with Electron codebases and repeated method calls?

Yes, this memory leak audit works with Electron codebases by identifying unsafe listener registration and disposable lifecycle patterns. It specifically applies to repeated method calls, model-bound resources, and pooled objects to prevent resource accumulation.