JVM tool guide · memoryGC Log Analysis: Read JVM Garbage-Collection Logs with GCViewer & gceasy
When a JVM shows excessive GC time or long pauses, the GC log is where the evidence lives. On modern JDKs (9+) GC logging is enabled with -Xlog, and the output can be graphed with GCViewer (a small Java tool) or uploaded to gceasy for an annotated report.
GC log analysis answers two questions: 'how much time is spent collecting' (throughput) and 'how long are individual pauses' (latency). That pairing is what tells you whether to change heap size, switch collectors (G1/ZGC/Shenandoah), or fix an allocation pattern.
Official GCViewer project
Enable GC logging (JDK 9+)
Use a Unified Logging -Xlog tag selector. A common production setting writes to a rolling file with rotation and includes the GC timestamps and safe-point info.
java -Xlog:gc*,gc+metaspace,gc+ref=info:file=gc.log:time,uptime,level,tags -jar app.jar
Enable GC logging (JDK 8)
Older style, still valid: -XX:+PrintGCDetails with timestamps and dates.
java -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:gc.log -jar app.jar
Read the raw log
Each GC line shows a pause (Pause Young / Pause Full), heap before->after, and the GC cause or reason. Look for frequent Full GCs and long 'Pause Full (Allocation Failure)' entries.
# Show the line type breakdown
grep -Eo 'Pause (Young|Full)[^]]*' gc.log | sort | uniq -c | sort -rn
Analyze with GCViewer
Open the .log in GCViewer for charts of pause time, heap usage and throughput, plus summary metrics like total pauses and max pause. Great when you have an offline log.
Analyze with gceasy
Upload a GC log to gceasy.io for an instant, annotated report: GC throughput %, worst GC pause, GC heap usage trends, and tuning hints — no local install.
Quick startGet productive in minutes
Minimal comparison run
Capture a log, read the two numbers that matter the most.
java -Xlog:gc=info:file=gc.log -jar app.jar
# then
grep -E 'Pause (Full|Young)' gc.log | wc -l
Last updated August 2026 · JVM Tools is independent and not affiliated with Oracle.