dotnet-allocation-triage
Installation
SKILL.md
.NET Allocation Triage Workflow
Find allocation hot spots statically, confirm they matter dynamically, fix, then verify — pairing dotnet-inspect (static, IL-precise) with a benchmark or profiler (dynamic, ground truth). This skill is the workflow; for tool capabilities, output modes, shapes, and flags, defer to the version-matched guide:
dnx dotnet-inspect -y -- skill
Workflow
- Triage statically. Build Release, then run
dotnet-inspect'sPerformance Triageover the assembly to get a ranked list of pay-dirt allocation sites (member, shape, fix, confidence, in-loop). The cheapest first pass — works on a binary and its dependencies, no profiler needed. See the embedded guide for the exact command and filters. - Confirm it's real. Static triage finds candidates; only a dynamic tool proves a win:
- Micro: wrap the hot method in a BenchmarkDotNet benchmark with
[MemoryDiagnoser]; record allocated bytes before/after. - Running app: capture a GC/allocation trace with
dotnet-trace collect --profile gc-verbose, or watchSystem.RuntimeGC counters withdotnet-counters monitor, and confirm the member shows up and shrinks.
- Micro: wrap the hot method in a BenchmarkDotNet benchmark with
- Fix, then re-triage to confirm the row is gone and re-benchmark to confirm the allocation dropped.