Java Garbage Collection Logging: Difference between revisions
Jump to navigation
Jump to search
Line 22: | Line 22: | ||
====-Xloggc==== | ====-Xloggc==== | ||
<pre> | <pre> | ||
Line 29: | Line 28: | ||
where <file> can be absolute or relative. In case of a relative path, it is relative to the current directory. | where <file> can be absolute or relative. In case of a relative path, it is relative to the current directory. | ||
====-XX:+PrintGC==== | |||
<pre> | |||
-XX:+PrintGC | |||
</pre> | |||
<pre> | <pre> |
Revision as of 03:16, 13 February 2017
Internal
Command Line Options
Java 8
Overview
In Java 8, GC logging is enabled with the -Xloggc:<file> (see below). The actual -XX values the JVM operates with are displayed at the top of the log file:
... CommandLine flags: -XX:InitialHeapSize=268435456 -XX:MaxHeapSize=4294967296 -XX:+PrintGC -XX:+PrintGCTimeStamps -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC ...
Options
-Xloggc
-Xloggc:<file>
where <file> can be absolute or relative. In case of a relative path, it is relative to the current directory.
-XX:+PrintGC
-XX:+PrintGC
-verbose:gc
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=3M