Usage:
-Xloggc:path-to-file.
Examples:
Show all messages for garbage collector to file:
java -Xloggc:gc.log
Description:
Logging of the garbage collector related information is possible using –Xloggc. It will create and rotate a file containing log information. After Java 9 was released it is possible to use –Xlog specifying gc as a tag, and the –Xloggc is available but deprecated.
Default Value:
The -Xloggc parameter does not have a fixed default value. If not specified then it will not produce any output. Sample outputs:
java -Xloggc:gc.log -version
[0.012s][info][gc] Using G1
[0.027s][info][gc] Periodic GC disabled
Errors:
None
Arguments related:
TODO link log, +UseGCLogFileRotation, NumberOfGCLogFiles, GCLogFileSize
Related Posts:
NOTE:
If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.
Edit your Comment