Friday, September 7, 2012

How to Read GC Logs in Java ?

Java provides an built-in garbage collection logging system through which you can quickly and easily troubleshoot Java applications. It helps in understanding the application in terms of memory usage, heap size and GC metrics.

Following are the sample GC Logs

    12345.094: [GC 695486K->557348K(806720K), 0.0191830 secs]
    167741.549: [Full GC 695054K->51454K(806720K), 1. 8452160 secs]

Information provided by Sample 1 :

12345.094: [GC 695486K->507268K (803840K), 0.0178593 secs]

    12345.094 – Time stamp since the JVM has started
    GC – Partial GC occurrence
    695486K – Heap (in KB) in used before GC runs
    507268K – Heap (in KB) in used after GC runs
    803840K – Total JVM size
    0.0178593 secs – Time taken for GC run

Information provided by Sample 2 :

167741.549: [Full GC 695054K->551454K (806720K), 1. 8452160 secs]

    167741.549 – Time stamp since the JVM has started
    Full GC – Full GC occurrence
    695054K – Heap (in KB) in used before GC runs
    51454K – Heap (in KB) in used after GC runs
    806720K – Total JVM size
    1. 8452160 secs – Time taken for GC run

No comments:

Post a Comment