Show all messages for garbage collector to file:
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.
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
TODO link log, +UseGCLogFileRotation, NumberOfGCLogFiles, GCLogFileSize
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