Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column

Java applications like JIRA and Confluence run in a "Java virtual machine" (JVM), instead of directly within an operating system. When started, the Java virtual machine is allocated a certain amount of memory, which it makes available to applications like JIRA. By default, Java virtual machines are allocated 64Mb of memory, no matter how many gigabytes of memory your server may actually have available. 64Mb is inadequate for medium to large JIRA installations, and so this needs to be increased. Seeing OutOfMemoryErrors in the logs is symptomatic of this.

(warning) This page addresses how to increase Heap Space memory. Confirm that you're not receiving Perm Gen or GC Overhead errors.

Column
width300px
Panel

On this page:

Table of Contents
maxLevel2
minLevel2

Include Page
_hostedNotApplicableNote
_hostedNotApplicableNote

Anchor
not_enough_memory
not_enough_memory

Step 1: Diagnosis

Expand
Expand to see diagnosis section
Expand to see diagnosis section

Assess Root Cause

Note

Often, there is a root cause for OutOfMemory Errors that may be better to address than just increasing memory. See JIRA Crashes Due to 'OutOfMemoryError Java heap space' for a discussion.

Determine JIRA usage patterns

In JIRA, go to Administration > System > System Info, and look at the memory graph during times of peak usage:

(info) This server has been allocated a maximum of 650Mb and a minimum of 256m. You can see the minimum displayed here; if you're trying to see whether your settings are being picked up, this is where to look. Of this, JIRA has reserved 543Mb, or which 310Mb is actually in use (this JIRA instance has about 6000 issues). If this JIRA instance were running out of memory, it would have reserved the maximum available (650Mb), and would be using an amount close to this.

Determine available system memory

Panel
bgColor#EAECFF
titleOn Windows

From the Close Programs Dialogue (Press ctrl-alt-delete), select the Performance tab:

(info) The amount marked Available is the amount in kilobytes you have free to allocate to JIRA. On this server we should allocate at most 214Mb.

Panel
bgColor#EAECFF
titleOn Linux

Run cat /proc/meminfo to view the memory usage.

Setting the -Xmx above the available amount on the server runs the risk of OutOfMemoryErrors due to lack of physical memory. If that occurs the system will use swap space, which greatly decreases performance.

Anchor
guidance
guidance

Guidance

As a rule of thumb, if you have fewer than 5000 issues, JIRA should run well with the default 768MB. Granting JIRA too much memory can impact performance negatively, so it is best to start with 768Mb and make modest increases as necessary. As another data point, 40,000 works well with 768MB to 1GB.

Step 2: Increase Available Memory

Linux

Expand
Expand to see Linux instructions
Expand to see Linux instructions
Panel
bgColor#EAECFF
titleTo increase heap space memory in Linux installations:
  1. In your <JIRA Installation Directory>/bin (for Standalone) or <Tomcat Installation Directory>/bin (for WAR), open the setenv.sh file.
  2. Find the sections JVM_MINIMUM_MEMORY= and JVM_MAXIMUM_MEMORY=
  3. See Diagnosis above and enter the appropriate values.

Windows (starting from .bat file)

Expand
Expand to see Windows .bat file instructions
Expand to see Windows .bat file instructions
Panel
bgColor#EAECFF
titleTo Configure System Properties in Windows Installations When Starting from the .bat File:
  1. In your <JIRA Installation Directory>/bin (for Standalone) or <Tomcat Installation Directory>/bin (for WAR), open the setenv.bat file.
  2. Find the section set JVM_MINIMUM_MEMORY= and set JVM_MAXIMUM_MEMORY=
  3. See Diagnosis above and enter the appropriate values.

Windows Service

Expand
Expand to see Windows Service instructions
Expand to see Windows Service instructions

There are two ways to configure system properties when starting Running JIRA Standalone as a Service, either via command line or in the Windows Registry.

Anchor
commandline
commandline

Setting Properties for Windows Services via Command Line

Panel
bgColor#EAECFF
titleSetting Properties for Windows Services via Command Line
  1. Identify the name of the service that JIRA is installed as in Windows ( Control Panel > Administrative Tools > Services ):

    (info) In the above example, the SERVICENAME is: JIRA030908110721
  2. Open the command window from Start > Run > type in 'cmd' > press 'Enter'
  3. cd to the bin subdirectory of your JIRA installation directory if you are running JIRA Standalone, or the bin subdirectory of your Tomcat installation directory if your are running JIRA WAR.
  4. Run:

    Code Block
    tomcat6w //ES//%SERVICENAME%
    

    (info) In the above example, it would be tomcat6w //ES//JIRA030908110721

  5. Click on the Java tab to see the list of current start-up options:
  6. Set the maximum memory allocation here

Anchor
registry
registry

Setting Properties for Windows Services via the Windows Registry

In some versions of Windows, there is no option to add Java variables to the service. In these cases, you must add the properties by viewing the option list in the registry.

Panel
bgColor#EAECFF
titleTo Set Properties for Windows Services via the Windows Registry,
  1. Go to Start > Run, and run "regedit32.exe".
  2. Find the Services entry:
    32-bit: HKEY_LOCAL_MACHINE > SOFTWARE > Apache Software Foundation > Procrun 2.0 > JIRA
    64-bit: HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > Apache Software Foundation > Procrun 2.0 > JIRA
  3. To change existing properties, especially increasing Xmx memory, double-click the appropriate value.
  4. To change additional properties, double-click options.
  5. Modify the memory allocations here.

Step 3: Verify Your Settings

Expand
Expand to see verification instructions
Expand to see verification instructions

To verify what settings are in place, check the <JIRA Home Directory>/logs/atlassian-jira.log or catalina.out file. A section in the startup appears like this:

Code Block
JVM Input Arguments : -Djava.util.logging.config.file=/usr/local/jira/conf/logging.properties -XX:MaxPermSize=256m -Xms256m -Xmx384m -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/jira/endorsed -Dcatalina.base=/usr/local/jira -Dcatalina.home=/usr/local/jira -Djava.io.tmpdir=/usr/local/jira/temp

(info) Look for Xmx (maximum) and Xms (minimum) settings.

This display is also available by Viewing your System Information.