How to change JVM arguments at runtime to avoid application restart

複数製品に共通のナレッジ

このページの内容

お困りですか?

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

コミュニティに質問

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

問題

In order for JVM arguments to become effective, application administrators need to modify configuration files and restart the application, so that the new settings are picked up. In production environments, this causes disruption in the service, which is undesirable.

回避策

Java SDK comes with a utility that can alter some of these arguments while the java process is running, making them effective without a restart. You can learn more about this tool on Oracle's tech note: jinfo - Oracle Help Center.

Not all of the available parameters can be changed, for a complete list of settings that can be modified, you can use the command below.

java -XX:+PrintFlagsFinal -version|grep manageable
 
     intx CMSAbortablePrecleanWaitMillis            = 100                                 {manageable}
     intx CMSTriggerInterval                        = -1                                  {manageable}
     intx CMSWaitDuration                           = 2000                                {manageable}
     bool HeapDumpAfterFullGC                       = false                               {manageable}
     bool HeapDumpBeforeFullGC                      = false                               {manageable}
     bool HeapDumpOnOutOfMemoryError                = false                               {manageable}
    ccstr HeapDumpPath                              =                                     {manageable}
    uintx MaxHeapFreeRatio                          = 100                                 {manageable}
    uintx MinHeapFreeRatio                          = 0                                   {manageable}
     bool PrintClassHistogram                       = false                               {manageable}
     bool PrintClassHistogramAfterFullGC            = false                               {manageable}
     bool PrintClassHistogramBeforeFullGC           = false                               {manageable}
     bool PrintConcurrentLocks                      = false                               {manageable}
     bool PrintGC                                   = false                               {manageable}
     bool PrintGCDateStamps                         = false                               {manageable}
     bool PrintGCDetails                            = false                               {manageable}
     bool PrintGCID                                 = false                               {manageable}
     bool PrintGCTimeStamps                         = false                               {manageable}

To change a specific parameter of the above, the command can be used as you can see in the following example (<PID> represents the process id for the corresponding Java process):

jinfo -flag +PrintGCDetails <PID>

Please note that the changes made via jinfo are not persistent, meaning if you restart the application they will revert back to their default value, set by your startup scripts. If you want the changes to be effective after a restart, you will need to modify your startup scripts accordingly.

参考


説明In order for JVM arguments to become effective, application administrators need to modify configuration files and restart the application, so that the new settings are picked up. In production environments, this causes disruption in the service, which is undesirable.
製品Jira, Confluence, Bitbucket, Bamboo, Fisheye, Crucible
プラットフォームサーバー
最終更新日: 2018 年 10 月 12 日

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

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