memory-leak-audit

Audit event listeners, disposables, and lifecycle patterns to prevent memory leaks.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/KaiBoo404/agent-skills-with-project-template --skill memory-leak-audit-kaiboo404
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-leak-audit
Source: https://github.com/KaiBoo404/agent-skills-with-project-template/tree/main/.agents/skills/memory-leak-audit
Command: npx skills add https://github.com/KaiBoo404/agent-skills-with-project-template --skill memory-leak-audit-kaiboo404

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Audits code for memory leaks and disposable issues. Use when reviewing code that registers event listeners or DOM handlers. Use when fixing reported memory leaks or listener counts growing over time. Use when working with model lifecycle events. Do not use for native mobile memory leaks or non-event-related large data structure issues.

Core Features & Use Cases

  • Detect and fix memory leaks by ensuring event listeners, subscriptions, and disposables are properly registered and disposed.
  • Enforce lifecycle-safe patterns like Event.once, MutableDisposable, and DisposableStore to guard against leaks.
  • Apply end-to-end memory-management checks across UI components, services, and models to stabilize object counts over time.

Quick Start

Audit a codebase to identify and fix memory-leak patterns and ensure proper disposal of listeners and lifecycle resources.

Frequently Asked Questions about memory-leak-audit

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

FAQPage Schema
How do I audit event listeners for memory leaks in TypeScript?

To audit event listeners for memory leaks, check that subscriptions and DOM handlers use disposable patterns and lifecycle hooks for proper cleanup. Enforcing scoped disposables ensures listener counts stabilize over time.

What is the best way to prevent memory leaks in UI components with repeated object allocations?

Preventing memory leaks in UI components requires applying end-to-end lifecycle checks using DisposableStore and MutableDisposable. These patterns manage repeated object allocations across methods and constructors to stabilize object counts.

Why does my application have a memory leak when registering model lifecycle events?

Memory leaks from model lifecycle events usually happen when subscriptions are not properly disposed. Using one-time events like Event.once and enforcing lifecycle-safe patterns guards against these leaks and stabilizes memory usage.

Can I use this memory leak audit for native mobile applications?

No, this memory leak audit is not for native mobile memory leaks or non-event-related large data structure issues. It specifically targets event listeners, disposables, and lifecycle patterns in UI components and services.

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

You need disposable patterns when reviewing code that registers event listeners or DOM handlers, or when fixing reported memory leaks where listener counts grow over time. They enforce proper registration and disposal of lifecycle resources.