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.
On this page:
- Step 1: Diagnosis
- Step 2: Increase Available Memory
- Step 3: Verify Your Settings
Step 1: Diagnosis
Assess Root Cause
Determine JIRA usage patterns
In JIRA, go to
Administration » System » System Info, and look at the memory graph during times of peak usage:
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
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.
As a rule of thumb, if you have fewer than 5000 issues, JIRA should run well with the default 256MB. Granting JIRA too much memory can impact performance negatively, so it's best to start with 256Mb and make modest increases as necessary. As another data point, 40,000 works well with 750MB.
Step 2: Increase Available Memory
Windows (starting from .bat file)
Setting Properties for Windows Services via Command Line
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.
Step 3: Verify Your Settings
To verify what settings are in place, check the
catalina.out file. A section in the startup appears like this:
Look for Xmx (maximum) and Xms (minimum) settings.
This display is also available by Viewing your System Information.