Garbage Collection Log Settings for Jira when using Java Version 11
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Problem
Trying to run JIRA leads to an error similar to the one below:
-XX:+PrintGCDateStamps --> Unrecognized VM option 'PrintGCDateStamps'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Environment
AdoptOpen JDK 11
Diagnosis
-
Cause
Starting with JIRA 8.2, we are supporting Java 8 and Java 11. The Garbage Collection Log Settings between these 2 versions are significantly different. Trying to run JIRA on Java 11 with the old settings will lead to errors like the ones mentioned above.
See 43 GC logging flags removed from Java 9 for more details.
When migrating from a setup with Java 8 to another with Java 11 the Javaflags have been taken over.
Solution
The following Java flags are no longer supported in Java 9 and upwards, as the Unified JVM Logging has been introduced
When running JIRA with Java 11, these flags below must be removed, otherwise JIRA will fail to start.
1
2
3
4
5
6
7
8
9
10
-XX:+PrintAdaptiveSizePolicy
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+PrintGCCause
-XX:+PrintTenuringDistribution
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=20M
-Xloggc:<PATH_TO_GC_LOGS>
Make sure to add the one below to keep logging GC activity.
1
-Xlog:gc*:file=<PATH_TO_GC_LOGS>:tags,time,uptime,level:filecount=5,filesize=20M
Additional Notes
Update: Failed to recognize file format in GCViewer
If you are analyzing the GC logs on GCViewer, you might run into this error :
1
Caused by: java.io.IOException: Failed to recognize file format.
This is due to JRASERVER-71420 - Java 11 GC logging configuration is not parseable in GCViewer
To work this around add tags and level to the configuration ("tags" and "level" parameters must be added):
1
-Xlog:gc*:file=<PATH_TO_GC_LOGS>:tags,time,uptime,level:filecount=5,filesize=20M
Was this helpful?