memory-leak-audit

Audit TypeScript/JavaScript code for disposable pattern memory leaks.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/colajacquin-e/ephcode --skill memory-leak-audit-colajacquin-e
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-leak-audit
Source: https://github.com/colajacquin-e/ephcode/tree/main/.github/skills/memory-leak-audit
Command: npx skills add https://github.com/colajacquin-e/ephcode --skill memory-leak-audit-colajacquin-e

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Memory leaks in codebases are a major source of performance degradation and instability. This Skill provides a disciplined audit framework to identify patterns that cause disposable objects to leak, such as improper lifecycle handling and uncleaned subscriptions.

Core Features & Use Cases

  • Systematic checks for common leak patterns in event listeners, DOM handlers, and lifecycle methods.
  • Guidance on applying disposable patterns (MutableDisposable, DisposableStore, Event.once) to prevent repeated registrations.
  • Use case: when you encounter growing listener counts or objects that persist beyond their intended lifetime, this Skill helps you diagnose and fix the root cause.

Quick Start

Audit a codebase by running a memory-leak audit on a module to detect disposable leaks and lifecycle misuses.

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 TypeScript event listeners?

Find memory leaks in TypeScript event listeners by auditing disposable patterns and lifecycle events. This process scans codebases for leak-prone registrations and provides remediation guidance to ensure objects are properly disposed.

What causes disposable objects to leak in JavaScript applications?

Disposable objects leak in JavaScript applications due to improper lifecycle handling and uncleaned subscriptions. Failing to manage event listener registrations or neglecting disposal patterns causes objects to persist beyond their intended lifetime.

How do I audit disposable patterns like DisposableStore in my codebase?

Audit disposable patterns like DisposableStore by scanning your codebase for improper lifecycle handling and repeated registrations. This identifies misused patterns and provides guidance on applying MutableDisposable and Event.once correctly.

When do I need to use disposable patterns to prevent memory leaks?

You need to use disposable patterns to prevent memory leaks when your code registers event listeners, DOM handlers, or manages object lifecycles. This is necessary when you encounter growing listener counts or objects persisting beyond their intended lifetime.

Does this memory leak audit work with DOM handlers and lifecycle methods?

Yes, this memory leak audit works with DOM handlers and lifecycle methods. It systematically checks these areas for common leak patterns, scanning for improper registrations and providing remediation guidance for your TypeScript codebase.

What is the best way to fix uncleaned subscriptions causing memory leaks?

The best way to fix uncleaned subscriptions causing memory leaks is applying disposable patterns like DisposableStore and Event.once. This prevents repeated registrations and ensures proper cleanup when objects reach the end of their lifecycle.