heap_histogram
Retrieve a static class histogram of the Java heap using jcmd GC.class_histogram. Shows the number of instances per class.
Instructions
Static class histogram (jcmd GC.class_histogram). For live growth over time use heap_live_histogram_diff instead.
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_histogram"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | Process ID of the Java application. Get this from list_java_processes. | |
| topN | No | Maximum number of top classes to return. Default: 20. | |
| all | No | Include unreachable objects. Triggers full GC and may cause application pause. |