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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pid": "<pid>"
},
"name": "get_gc_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) |