Java バージョン 11 利用時の Jira のガベージ コレクション ログ設定
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
問題
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.
診断
環境
AdoptOpen JDK 11
原因
Starting with JIRA 8.2 we are supporting Java 8 and Java 11. There are significant differences in the Garbage Collection Log Settings between these 2 versions. Trying to run JIRA on Java 11 with the old settings will lead to errors like 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.
ソリューション
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.
-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>
GC アクティビティをログするには次のものを追加するようにします。
-Xlog:gc*:file=<PATH_TO_GC_LOGS>:tags,time,uptime,level:filecount=5,filesize=20M
その他の注意事項
Update: Failed to recognize file format in GCViewer
If you are analyzing the GC logs on GCViewer, you might run into this error :
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):
-Xlog:gc*:file=<PATH_TO_GC_LOGS>:tags,time,uptime,level:filecount=5,filesize=20M