heap_live_histogram_diff
Detects memory leaks by comparing two heap class histograms and listing classes with the greatest instance count growth over a configurable interval.
Instructions
Two GC.class_histogram snapshots spaced by intervalSeconds; returns classes whose instance count grew most. Use first in memory-leak workflow; then profile_memory and heap_dump (MAT path-to-GC-roots). Each snapshot walks the heap and may pause the app.
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": "heap_live_histogram_diff"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | Process ID from list_java_processes. | |
| intervalSeconds | No | Seconds between baseline and snapshot histograms. Default: 5. | |
| topN | No | ||
| all | No | Include unreachable objects (-all). Triggers full GC and may pause the app. | |
| minInstanceDelta | No | Ignore classes with instance growth below this threshold. |