Unrecognized JVM GC options when using JDK 11/17

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 JDK 11/17, some JVM parameters previously applied to Tomcat are now unrecognized, preventing Confluence to start

Environment

Confluence 7.19 or Confluence 8 running with JDK 11/17+

Diagnosis

When using JDK 11/17 with Confluence, if you still have JVM options from a previous JDK 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 JDK 11/17 some JVM flags including those used in JDK 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/17:

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


Starting in JDK 9, 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, where some examples as listed:

Solution

Convert the GC options to the new Xlog format, being sure of removing the unrecognized options for JDK 11/17 listed above. As an example, check the following System Properties

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



Last modified on Apr 26, 2024

Was this helpful?

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