get_gc_events
Retrieve recent garbage collection events from a .NET process to diagnose response time spikes and memory issues. Provides generation, duration, pause time, and timestamps.
Instructions
Returns recent GC events for a target .NET process including collection generation (Gen0/Gen1/Gen2), duration, pause time, and timestamp. Use this when investigating periodic response time spikes, application pauses, memory that grows without releasing, or when get_memory_stats shows high Gen2 collection counts. Call get_memory_stats first to establish whether GC pressure is the root cause before drilling into individual events.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | The process ID (PID) of the target .NET application | |
| sampleSeconds | No | How long to collect GC events in seconds (default: 5) |