# Sample: diagnosing thread pool starvation from a .NET dump

StarvationDemo queues 500 work items that block on an async call. The thread pool keeps injecting threads,
the CPU stays idle, and the application stops making progress.

    ./collect.sh              # counters timeline + artifacts/starvation.dmp
    ./run-in-docker.sh        # same, inside a Linux container (use this on macOS)

Then let the agent investigate:

    dotnet-dump analyze artifacts/starvation.dmp -c "threadpool" -c "parallelstacks" -c "exit"
    dotnet-dump analyze artifacts/starvation.dmp -c "dumpasync --stats" -c "exit"

artifacts/counters.json is the timeline. Counters whose name ends with "/ N sec" are the delta over the
interval, not an absolute value.

.claude/skills/analyzing-dotnet-dumps/SKILL.md is the skill the agent uses. Claude Code and GitHub Copilot read
it from that path as is; for Codex, move the analyzing-dotnet-dumps folder to .agents/skills/.

Prerequisites: .NET 10 SDK, dotnet-dump and dotnet-counters:

    dotnet tool install --global dotnet-dump
    dotnet tool install --global dotnet-counters
