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★ 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 --memstampand useai/scripts/perfviz.py(numbers) orai/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::
- Reproduce locally:
Run-Tests.ps1 -TestName <test>— confirm it fails - Profile:
Run-Tests.ps1 -TestName <test> -MemoryProfile -MemoryProfileWaitRuns 0 - Ask the user to open the
.dmwfile in dotMemory GUI and share a screenshot of Key Retention Paths for the leaked type (e.g., SkylineWindow) - Read the screenshot to identify the retention chain
- Fix the retention chain (dispose timers, null delegates, clear caches)
- Verify: run without profiling to confirm test passes
- 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:
- Select test: Choose test with highest handles-leaked-per-second ratio
- Reproduce:
Run-Tests.ps1 -TestName <test> -Loop 10 -ReportHandles -SortHandlesByCount - Identify type: Which handle category is growing? (User, GDI, kernel)
- Bisect: Add
return;to narrow down which test operation causes the leak - 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
Установить 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), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic