How to Enable Garbage Collection (GC) Logging for Synchrony process

お困りですか?

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

コミュニティに質問

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

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.

*Fisheye および Crucible は除く

目的

Staring in Confluence 7.20, if Synchrony is managed by Confluence (the most common setup), you can make changes to Synchrony JVM flags by updating:

  • <CONFLUENCE_HOME>/synchrony-args.properties (for Confluence Server); or
  • <CONFLUENCE_SHARED_HOME>/synchrony-args.properties (for Confluence Data Center environment)

This new feature was introduced by the implementation of CONFSERVER-53548 - Getting issue details... STATUS

The following instructions are applicable for JDK8 and JDK11/17, depending on the version used by your Confluence instance. 

Linux

To configure Synchrony JVM arguments in Linux installations:

  1. Edit the relevant synchrony-args.properties file (see above)
  2. Add in these lines (substitute both <CONFLUENCE_INSTALL> with the actual Confluence Install Directory):

    When running Confluence with JDK 8
    synchrony.jvm.arg.0=-XX:+IgnoreUnrecognizedVMOptions
    synchrony.jvm.arg.1=-Xlog:gc+age=debug:file=<CONFLUENCE_INSTALL>/logs/synchrony-gc-%t.log:filecount=5,filesize=2M
    synchrony.jvm.arg.2=-Xloggc:<CONFLUENCE_INSTALL_DIR>/logs/synchrony-gc-%t.log
    synchrony.jvm.arg.3=-XX:+UseGCLogFileRotation
    synchrony.jvm.arg.4=-XX:NumberOfGCLogFiles=5
    synchrony.jvm.arg.5=-XX:GCLogFileSize=2M
    synchrony.jvm.arg.0=-XX:+IgnoreUnrecognizedVMOptions
    synchrony.jvm.arg.1=-Xlog:gc+age=debug:file=/opt/atlassian/confluence/logs/synchrony-gc-%t.log:filecount=5,filesize=2M
    synchrony.jvm.arg.2=-Xloggc:/opt/atlassian/confluence/logs/synchrony-gc-%t.log
    synchrony.jvm.arg.3=-XX:+UseGCLogFileRotation
    synchrony.jvm.arg.4=-XX:NumberOfGCLogFiles=5
    synchrony.jvm.arg.5=-XX:GCLogFileSize=2M
    When running Confluence with JDK 11/17
    synchrony.jvm.arg.0=-Xlog:gc*:file=<CONFLUENCE_INSTALL>/logs/synchrony-gc-%t.log:tags,time,uptime,level:filecount=5,filesize=2M
    synchrony.jvm.arg.0=-Xlog:gc*:file=/opt/atlassian/confluence/logs/synchrony-gc-%t.log:tags,time,uptime,level:filecount=5,filesize=2M
  3. Navigate to Confluence Administration » General Configuration » Collaborative Editing
  4. Click Restart Synchrony
  5. Check that the <CONFLUENCE_INSTALL>/logs  contains newly created synchrony-gc-* files

(info) If Confluence is running in a Cluster, you will need to restart Synchrony process on each Node (one at a time).

Windows

To configure Synchrony JVM arguments in Windows installations:

  1. Edit the relevant synchrony-args.properties file (see above)
  2. Add in these lines (substitute both <CONFLUENCE_INSTALL> with the actual Confluence Install Directory):

    When running Confluence with JDK 8
    synchrony.jvm.arg.0=-XX:+IgnoreUnrecognizedVMOptions
    synchrony.jvm.arg.1=-Xlog:gc+age=debug:file=<CONFLUENCE_INSTALL>\\logs\\synchrony-gc-%t.log:filecount=5,filesize=2M
    synchrony.jvm.arg.2=-Xloggc:<CONFLUENCE_INSTALL_DIR>\\logs\\synchrony-gc-%t.log
    synchrony.jvm.arg.3=-XX:+UseGCLogFileRotation
    synchrony.jvm.arg.4=-XX:NumberOfGCLogFiles=5
    synchrony.jvm.arg.5=-XX:GCLogFileSize=2M
    synchrony.jvm.arg.0=-XX:+IgnoreUnrecognizedVMOptions
    synchrony.jvm.arg.1=-Xlog:gc+age=debug:file=C:\\Program Files\\Atlassian\\Confluence\\logs\\synchrony-gc-%t.log:filecount=5,filesize=2M
    synchrony.jvm.arg.2=-Xloggc:C:\\Program Files\\Atlassian\\Confluence\\logs\\synchrony-gc-%t.log
    synchrony.jvm.arg.3=-XX:+UseGCLogFileRotation
    synchrony.jvm.arg.4=-XX:NumberOfGCLogFiles=5
    synchrony.jvm.arg.5=-XX:GCLogFileSize=2M

    (warning) Escape backslashes by using two backslashes as above example
    (warning) Do not use forward slashes (i.e. / ) for the path on Windows
    (warning) Do not use double quotes for the path

    When running Confluence with JDK 11/17
    synchrony.jvm.arg.0=-Xlog:gc*:file=<CONFLUENCE_INSTALL_DIR>\\logs\\synchrony-gc-%t.log:tags,time,uptime,level:filecount=5,filesize=2M
    synchrony.jvm.arg.0=-Xlog:gc*:file=C:\\Program Files\\Atlassian\\Confluence\\logs\\synchrony-gc-%t.log:tags,time,uptime,level:filecount=5,filesize=2M

    (warning) Escape backslashes by using two backslashes as above example
    (warning) Do not use forward slashes (i.e. / ) for the path on Windows
    (warning) Do not use double quotes for the path

  3. Navigate to Confluence Administration » General Configuration » Collaborative Editing
  4. Click Restart Synchrony
  5. Check that the <CONFLUENCE_INSTALL>\logs contains newly created synchrony-gc-* files

(info) If Confluence is running in a Cluster, you will need to restart Synchrony process on each Node (one at a time).


Differences between JDK 8 and JDK11/17

For further information about the different GC configuration between JDK8 and JDK11/17, please check our KB Unrecognized JVM GC options when using JDK 11/17




最終更新日 2024 年 4 月 26 日

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

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