Garbage Collection Log Settings for Bitbucket Server 6+ when using Java Version 11

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。

問題

Since Java 9, the garbage collection JVM arguments have changed, as the Unified JVM Logging has been introduced. Using GC arguments such as those  supported in Java 8  such as

-Xloggc:<PATH_TO_GC_LOGS>
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+PrintGCCause
-XX:+UseG1GC
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=20M


 Bitbucket will not start, as the JVM will fail with errors (example from Windows Service):

[info] [ 5516] Starting service...
[error] [ 7324] CreateJavaVM Failed
[error] [ 7324] The system cannot find the file specified.
[error] [ 5516] Failed to start Java
[error] [ 5516] ServiceStart returned 4
[info] [ 6956] Run service finished.
[info] [ 6956] Commons Daemon procrun finished

診断

環境

  • AdoptOpen JDK 11 

ソリューション

To map old GC flags to the new ones you can reference  43 GC logging flags removed from Java 9

The following Java flags are no longer supported in Java 9 and upwards, as the Unified JVM Logging has been introduced


-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+PrintGCCause
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=20M
-Xloggc:<PATH_TO_GC_LOGS>

You must remove these flags when running Bitbucket with Java 11, otherwise Bitbucket Server will fail to start. Make sure to add the one below to keep logging GC activity.

-Xlog:gc*:file=<PATH_TO_GC_LOGS>:time,uptime:filecount=5,filesize=20M


(warning) For Windows environments, the <PATH_TO_GC_LOGS> may give an error with using a drive such as D: in the path, due to the new syntax. This has been addressed in specific versions of Oracle, OpenJDK, AdoptOpenJDK.

In AdoptOpenJDK the fixed version is AdoptOpenJDK 11.0.6+10. 



Last modified on Mar 17, 2020

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.