Useful JVM Flags - Part 8 (GC Logging) - codecentric AG Blog
The last part of this series is about garbage collection logging and associated flags. The GC log is a highly important tool for revealing potential improvements to the heap and GC configuration or the object allocation pattern of the application. For each GC happening, the GC log provides exact data about its results and duration.
-XX:+PrintGC
The flag -XX:+PrintGC
(or the alias -verbose:gc
) activates the "simple" GC logging mode, which prints a line for every young generation GC and every full GC. Here is an example:
[GC 246656K->243120K(376320K), 0,0929090 secs]
[Full GC 243120K->241951K(629760K), 1,5589690 secs]
A line begins (in red) with the GC type, either "GC" or "Full GC". Then follows (in blue) the occupied heap memory before and after the GC, respectively (separated by an arrow), and the current capacity of the heap (in parentheses). The line concludes with the duration of the GC (real time in seconds).
Read full article from Useful JVM Flags - Part 8 (GC Logging) - codecentric AG Blog
No comments:
Post a Comment