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.
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. |