Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

leak-debugging

БесплатноБез исполняемых скриптовНе проверен

Load when investigating handle leaks, GC-LEAK failures, or memory NOT released after work completes. Covers handle counting, dotMemory profiling, and GC leak…

ProteoWizardот ProteoWizard★ 21 звезда на GitHub

Об этом скилле

Leak Debugging

First, decide which problem you have. A leak is "never released". Memory that grows with the SIZE of the workload - more files, more rows - and is freed when the run ends is a SCALING problem, and none of the tools below will find it. For that, read the memory band: run with --timestamp --memstamp and use ai/scripts/perfviz.py (numbers) or ai/scripts/perfviz.html (plot) to see whether each unit of work returns to the same memory floor. Full method: ai/docs/memory-band-guide.md.

Specialized workflows for investigating handle leaks, managed memory leaks, and GC leak tracker failures in Skyline tests.

Core Documentation

Read before investigating any leak:

ai/docs/leak-debugging-guide.md - Complete reference covering:

  • Handle leak detection and bisection (User/GDI/kernel handles)
  • dotMemory profiling for managed memory leaks
  • GC leak tracker (GC-LEAK Objects not garbage collected after test:)
  • Case studies with step-by-step investigation examples

Quick Reference: Which Leak Type?

Error Message Type Section
GC-LEAK Objects not garbage collected after test: SkylineWindow, SrmDocument GC leak "GC Leak Tracker" section
Handle counts growing in nightly tests Handle leak "Investigation Methodology" section
Memory growing but handles stable Managed memory leak "Memory Profiling with dotMemory" section

GC Leak Workflow (Most Common)

When you see GC-LEAK Objects not garbage collected after test::

  1. Reproduce locally: Run-Tests.ps1 -TestName <test> — confirm it fails
  2. Profile: Run-Tests.ps1 -TestName <test> -MemoryProfile -MemoryProfileWaitRuns 0
  3. Ask the user to open the .dmw file in dotMemory GUI and share a screenshot of Key Retention Paths for the leaked type (e.g., SkylineWindow)
  4. Read the screenshot to identify the retention chain
  5. Fix the retention chain (dispose timers, null delegates, clear caches)
  6. Verify: run without profiling to confirm test passes
  7. Negative test: comment out fix, confirm test fails again

IMPORTANT: Step 3 requires a human. Do NOT attempt to guess retention paths — dotMemory shows you exactly what's holding the object alive. Guessing wastes time when the answer is one screenshot away.

Handle Leak Workflow

When nightly tests show growing handle counts:

  1. Select test: Choose test with highest handles-leaked-per-second ratio
  2. Reproduce: Run-Tests.ps1 -TestName <test> -Loop 10 -ReportHandles -SortHandlesByCount
  3. Identify type: Which handle category is growing? (User, GDI, kernel)
  4. Bisect: Add return; to narrow down which test operation causes the leak
  5. Fix and validate: Re-run loop test, confirm handles are stable

Common GC Leak Patterns

Pattern Example Fix
Undisposed Timer UpdateManager Timer in GraphSpectrum Dispose in OnHandleDestroyed
Static delegate chain UpgradeManager.AppDeployment → delegates → SkylineWindow Make holder IDisposable, using pattern
Static tracking list ReplicateCachingReceiver._cachedSinceTracked Start/End pattern that nulls the list
Event handler subscription Component subscribes to long-lived source Unsubscribe in Dispose

Related Skills

  • debugging - General debugging methodology (cycle time, bisection, printf)
  • skyline-nightlytests - Query nightly test data for leak trends
  • skyline-development - For implementing fixes after isolation
Полный SKILL.md на GitHub

Установить leak-debugging в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл leak-debugging?

Load when investigating handle leaks, GC-LEAK failures, or memory NOT released after work completes. Covers handle counting, dotMemory profiling, and GC leak tracker workflows. For memory that grows with WORKLOAD SIZE (more files/rows) and is freed at exit, that is a scaling problem, not a leak - see ai/docs/memory-band-guide.md.

Как установить скилл leak-debugging?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл leak-debugging запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить leak-debugging с