Java Garbage Collection Logging: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=


* [[Java Garbage Collection#Garbage_Collection_Logging|Java Garbage Collection]]
* [[Java Memory#Garbage_Collection_Logging|Java Memory]]


=Command Line Options=
=Java 9=


==Java 8==
"-Xloggc:" becomes "-Xlog:gc:"


{{External|https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html#BABFAFAE}}
'PrintGCDateStamps' was dropped.


===Overview===
=Java 8=


In Java 8, GC logging is enabled with the <tt>[[#-Xloggc:|-Xloggc:<file>]]</tt> (see below). The actual -XX values the JVM operates with are displayed at the top of the log file:
{{Internal|Java 8 Garbage Collection Logging#Overview|Java 8 Garbage Collection Logging}}


<pre>
=Application Specific GC Logging=
...
CommandLine flags: -XX:InitialHeapSize=268435456 -XX:MaxHeapSize=4294967296 -XX:+PrintGC -XX:+PrintGCTimeStamps -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC
...
</pre>


===Options===
==WildFly GC Logging==


====-Xloggc:====
{{Internal|WildFly_JVM_Settings#Standalone_Mode_GC_Logging|WildFly GC Logging in Standalone Mode}}
 
{{Internal|WildFly_JVM_Settings#Domain_Mode_GC_Logging|WildFly GC Logging in Domain Mode}}
<pre>
-Xloggc:<file>
</pre>
 
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>
 
Enables printing of messages at every GC. By default, this option is disabled, but [[]] turns it on implicitly.
 
 
 
 
 
 
 
 
 
<pre>
-verbose:gc
</pre>
 
<pre>
-XX:+PrintGCDetails
</pre>
 
<pre>
-XX:+PrintGCDateStamps
</pre>
 
<pre>
-XX:+UseGCLogFileRotation
</pre>
 
<pre>
-XX:NumberOfGCLogFiles=5
</pre>
 
<pre>
-XX:GCLogFileSize=3M
</pre>

Latest revision as of 19:22, 28 December 2020

Internal

Java 9

"-Xloggc:" becomes "-Xlog:gc:"

'PrintGCDateStamps' was dropped.

Java 8

Java 8 Garbage Collection Logging

Application Specific GC Logging

WildFly GC Logging

WildFly GC Logging in Standalone Mode
WildFly GC Logging in Domain Mode