Supported GC log formats

Updated at:

This topic describes the JDK types, versions, GC types, and JVM parameters that are supported by the GC log analysis tool.

Note

In this topic, "supported" means that the log can be parsed correctly and its content is analyzed by the tool. "Ignored" means that the log can be parsed correctly, but its content is ignored. "Unsupported" means that using the feature may cause parsing exceptions or incorrect results.

Supported JDK types

This tool supports only GC logs generated by OpenJDK and its downstream distributions.

Supported JDK versions

This tool supports GC logs from Java 8, 11, 17, and 21. Correct parsing is not guaranteed for other JDK versions because they are not long-term support (LTS) versions.

Supported GC types

GC type

Corresponding JVM parameter

Support status

Serial GC

-XX:+UseSerialGC

Supported.

Parallel GC

-XX:+UseParallelGC

Supported.

CMS GC

-XX:+UseConcMarkSweepGC

Supported.

G1 GC

-XX:+UseG1GC

Supported.

Shenandoah GC

-XX:+UseShenandoahGC

Unsupported.

Non-generational ZGC

-XX:+UseZGC

(-XX:-ZGenerational after JDK 21)

Supported.

Generational ZGC

-XX:+UseZGC

-XX:+ZGenerational

Unsupported

Epsilon GC

-XX:+UseEpsilonGC

Unsupported.

Supported JVM parameters

Regardless of the JDK version, log printing must meet the following requirements:

  1. At least one parameter for log printing timestamps is enabled.

  2. Do not print GC logs to stdout. Stdout may contain other logs that can interfere with parsing.

JDK 8

In most cases, use the following parameters for GC log printing: -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:gc.log. You can enable other features as needed.

The support for specific parameters is as follows:

Parameter

Support status

More info

PrintGCDetails

Supported.

PrintGC

Supported.

Recommended:

-XX:+PrintGCDetails

PrintGCDateStamps

PrintGCDateStamps and

The `PrintGCTimeStamps` parameter must be enabled to use this feature.

Recommended:

-XX:+PrintGCDateStamps

PrintGCTimeStamps

PrintGCDateStamps and

This operation is supported only when PrintGCTimeStamps is enabled.

Recommended:

-XX:+PrintGCDateStamps

verbose:gc

Supported.

Recommended:

  • -XX:+PrintGCDetails

  • -XX:+PrintGCDateStamps

Xlog:gc

This parameter must be set.

ATP does not support analyzing GC logs from stdout.

PrintGCCause

Supported. You cannot disable this parameter.

Keep the default setting.

PrintGCID

Supported.

UseGCLogFileRotation

The tool supports analysis of only a single log file. It does not support merging and uploading multiple rotated GC logs for analysis.

Output from parameters not listed above is ignored.

JDK 9 and later

In JDK 9, the log printing system was completely refactored into what is known as Unified Logging. For more information, see the official Oracle documentation. To ensure proper parsing, GC log printing parameters must meet the two requirements mentioned earlier. In most cases, use the parameter -Xlog:gc*:gc.log:time. You can enable other features as needed.

ATP currently supports the analysis of GC log content from `-Xlog:gc*` or `-Xlog:gc`. More detailed logs are ignored.