JVM tool guide · jvm clijstat: Live JVM Statistics for GC and Class-Loading
jstat prints live JVM statistics — garbage-collection counts and times, class-loading, and JIT-compilation rates — for a local JVM. Because it is command-line and cheap, it is ideal for sampling a process in a tight loop to see how the heap and collector are trending.
The most useful invocations combine a statistic with an interval: the classic jstat -gcutil 1000 10 prints GC-utilization percentages every second for ten samples.
Official jstat project
GC utilization over time
-gcutil shows per-generation percentages. The classic loop: sample every second, 10 times. Rising S0/S1 and Old numbers with repeated full GCs say 'pressure'.
# Every 1s, 10 samples
jstat -gcutil <pid> 1000 10
GC counts and times
-gc adds raw counts and accumulated times for each event type. Columns ending in C/O/U are capacity/used; FGC/FGCT are full-GC count and total time.
jstat -gc <pid> 1000 10
Class-loading and JIT stats
-class shows loaded/unloaded classes; -compiler shows JIT start, compiled-method counts, and (on some JVMs) failed compilations.
jstat -class <pid>
jstat -compiler <pid>
A watch loop for 'is it leaking?'
Watch Old-gen usage trend steadily upward across many samples — a classic leak fingerprint. Combine with -gcutil.
watch -n 5 "jstat -gcutil <pid>"
Quick startGet productive in minutes
Confirm a JVM is healthy
Sample GC utilization for 20 seconds and look for a stable, non-flatlining heap.
jstat -gcutil <pid> 1000 20
Last updated August 2026 · JVM Tools is independent and not affiliated with Oracle.