Unrecognized JVM GC options when using JAVA 11

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When using Java 11, some JVM parameters previously applied to Tomcat are now unrecognized.

Environment

  • Confluence
  • Java 11 / OpenJDK 11

Diagnosis

When using Java 11 with Confluence, if you still have JVM options from a previous Java 8 installation you may find the application will not start and the following or similar messages are printed in the logs:

Unrecognized VM option 'UseGCLogFileRotation'
 Error: Could not create the Java Virtual Machine.
 Error: A fatal exception has occurred. Program will exit.

Cause

In Java 11 some JVM flags including those used in Java 8 for Garbage Collection Logging have been removed.

If these are still contained in the JVM flags specified in the setenv.sh or setenv.bat the JVM will not be able to start.

It's known that the following options are unrecognized in Java 11:

  • -d64
  • PrintGCTimeStamps
  • PrintGCDateStamps
  • PrintTenuringDistribution
  • PrintGCCause
  • PrintGCDetails
  • UseGCLogFileRotation
  • NumberOfGCLogFiles
  • GCLogFileSize


In Java 11, these GCLog options are now handled by Xlog, there is a conversion table below:

More information about this change can be found in the following Stackoverflow article:

Solution

Either add the following JVM option to the setenv.sh or setenv.bat file (option 1), or convert the GC options to the new Xlog format (option 2). For option 2, be sure to remove the unrecognized options for Java 11 from the list above.

Option 1
XX:+IgnoreUnrecognizedVMOptions
Option 2
CATALINA_OPTS="-Xlog:gc*:file=$LOGBASEABS/logs/gc-%t.log:tags,time,uptime,level:filecount=5,filesize=2M ${CATALINA_OPTS}"



Last modified on Dec 16, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.