一键导入
leak-debugging
Load when investigating handle leaks, memory leaks, or GC-LEAK failures. Covers handle counting, dotMemory profiling, and GC leak tracker workflows.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Load when investigating handle leaks, memory leaks, or GC-LEAK failures. Covers handle counting, dotMemory profiling, and GC leak tracker workflows.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
ALWAYS load when working in pwiz_tools/Osprey (C# port), on maccoss/osprey (Rust), or debugging Osprey-Rust parity issues.
ALWAYS load before git commit, push, or PR - team-specific commit format differs from standard conventions.
ALWAYS load when working on LabKey Server modules (MacCossLabModules, targetedms), in a LabKey enlistment directory, or on GitHub issues/PRs in LabKey repositories.
ALWAYS load when working in pwiz_tools/Skyline, on GitHub issues labeled 'skyline', or TODOs referencing Skyline code.
Invoke when starting an autonomous overnight session ("this is a nighttime autonomous session"). Sets a deep-investigation posture - premium on progress and high-definition findings, expects 5-8 hours of work without check-ins.
ALWAYS load when investigating bugs, failures, or unexpected behavior - ensures root cause analysis before attempting fixes.
| name | leak-debugging |
| description | Load when investigating handle leaks, memory leaks, or GC-LEAK failures. Covers handle counting, dotMemory profiling, and GC leak tracker workflows. |
Specialized workflows for investigating handle leaks, managed memory leaks, and GC leak tracker failures in Skyline tests.
Read before investigating any leak:
ai/docs/leak-debugging-guide.md - Complete reference covering:
GC-LEAK Objects not garbage collected after test:)| 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 |
When you see GC-LEAK Objects not garbage collected after test::
Run-Tests.ps1 -TestName <test> — confirm it failsRun-Tests.ps1 -TestName <test> -MemoryProfile -MemoryProfileWaitRuns 0.dmw file in dotMemory GUI and share a screenshot
of Key Retention Paths for the leaked type (e.g., SkylineWindow)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.
When nightly tests show growing handle counts:
Run-Tests.ps1 -TestName <test> -Loop 10 -ReportHandles -SortHandlesByCountreturn; to narrow down which test operation causes the leak| 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 |