Using Garbage Collection Logs to Analyze JIRA Application Performance

Still need help?

The Atlassian Community is here for you.

Ask the community

This article only applies to Atlassian's server products. Learn more about the differences between cloud and server.

The instructions here are for JIRA 7.3 and older only.

We've improved the garbage collection logs starting from JIRA 7.4, and they're now generated automatically, you'll be able to find them in your logs at <installation-directory>/logs.

JIRA Software 7.4.x release notes


Garbage Collection

JIRA applications are robust applications that rarely require in-depth garbage collection (GC) tuning. However, on large scale installations, GC tuning can improve the performance of JIRA applications. Analysis of GC logs can also assist in troubleshooting performance problems with a JIRA application. Starting from JIRA 7.4, GC logs are generated automatically, and you can find them in <installation-directory>/logs.

Diagnosis

Verbose garbage collection will generate log statements that indicate when Java is collecting garbage, how long this process takes, and how much memory has been freed. You can enable verbose garbage collection by adding the below options to the JVM, as in our Setting Properties and Options on Startup documentation.

The Xloggc parameter must use the full path for the location of the GC logs, as in the below examples. We recommend putting them in the $JIRA_HOME/log directory as when generating a Support Zip they will be included. If your directory is different than the default, please use that directory.

The parameter -XX:+PrintGCCause was introduced within Java 1.7.0_45 and will not work if you are using a version of Java prior to that version. Please check the version of Java that is being used by your instance of JIRA prior to using this flag.

Using Linux:

-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCCause -Xloggc:/var/atlassian/application-data/jira/log/atlassian-jira-gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M

Using Unix:

-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCCause -Xloggc:/var/atlassian/application-data/jira/log/atlassian-jira-gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M

Using Windows:

-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+PrintGCCause
-Xloggc:C:\Program Files\Atlassian\Application Data\JIRA\log\atlassian-jira-gc-%t.log
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=20M

Analysis

  1. Once you have added these options and restarted your JIRA applications, the log specified by the -Xloggc parameter will record memory usage information that can be analyzed using tools like GCViewer.
  2. A more complete guide to the practices and principles of GC tuning can be found at Garbage Collection (GC) Tuning Guide.
  3. Java VisualVM can also be installed and used to bind to the process that is running your JIRA applications. This can be used to analyze CPU utilization by GC, along with the heap usage. The visualGC plugin is recommended to be installed as it will provide a visual breakdown of each heap space.
  4. To better understand GC, you can also take a look at third-party blogs, such as Java Garbage Collection Distilled

In addition to GC logging, you can also use heap dumps for analysis. For more information, see Using Memory Dumps to Analyze OutOfMemoryErrors.

Recommendations

It is unwise to provide general recommendations for all situations - there is no substitute for an in-depth assessment using analysis tools. Atlassian recommends engaging the services of an Atlassian Expert for performance analysis of your JIRA applications and the environment it runs in.

Please see our Troubleshooting Performance Problems  documentation for further assistance with diagnosing performance problems.



Description This page discusses analysis of GC logs that can assist in troubleshooting performance problems with a JIRA application.
Last modified on Jan 2, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.