Search the JIRA 5.0.x Beta and RCs Documentation:

Index
Downloads (PDF, HTML & XML formats)
Other versions

This documentation relates to JIRA 5.0.x Beta and RCs only.
The latest official version is JIRA 4.4.x
If you are using JIRA 4.4.x either view this page in the JIRA 4.4.x documentation or visit the JIRA 4.4.x documentation home page.
Skip to end of metadata
Go to start of metadata

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.

(warning) The information on this page does not apply to JIRA OnDemand.

Step 1: Diagnosis

 Expand to see diagnosis section

Assess Root Cause

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

On 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.

On 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.

Guidance

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

Linux

 Expand to see Linux instructions
To increase heap space memory in Linux installations:
  1. In your <JIRA Installation Directory>/bin (or <Tomcat Installation Directory>/bin for JIRA WAR installations), 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 to see Windows .bat file instructions
To Configure System Properties in Windows Installations When Starting from the .bat File:
  1. In your <JIRA Installation Directory>/bin (or <Tomcat Installation Directory>/bin for JIRA WAR installations), 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 to see Windows Service instructions

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

Setting Properties for Windows Services via Command Line

Setting 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 (or the bin subdirectory of your Tomcat installation directory if your are running the JIRA WAR distribution).
  4. Run:

    (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

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.

To 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 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:

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

This display is also available by Viewing your System Information.

  1. Sep 15, 2005

    The -server option and the -Xms are also usefull on Tomcat .

    set JAVA_OPTS=-server -Xms512m -Xmx512m

    By default Tomcat is running in client mode.
    Xms is the initial allocated memory and Xmx the maximum memory.
    For better performance you should set both to the same value.

  2. Oct 05, 2005

    to update the memory when running embedded tomcat as a service.

    Open command prompt, change to Jira\bin

    run "service remove jira" (or whatever name you used)

    edit the service.bat file and look for& edit the line
    "%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp" --JvmMs 512 --JvmMx 512

    in the line above I increased my memory to 512 initial and max.

    then run "service install jira"

    start the service and you should be in business.

  3. Apr 06, 2006

    Abyone give some advice on how to do this in Websphere?  Webpsphere always allocates 256Mb to each application no matter how we start it.  At the moment we're getting a lot of out of memory errors.

    1. Apr 10, 2006

      Darren, this can be done through the Web Console:
      Servers > Application Servers > server_name > Process Definition > Java Virtual Machine

      You can then define the Initial Heap size and the Max heap size.

      You will need to bounce the server.

      Cheers,
      Nick

  4. Jul 18, 2006

    Hi.  The link under the Permanent Generation Space section doesn't seem to work.  Anyone know the specific article it is trying to point you to?  I see it's at www.theserverside.com but beyond that I haven't found it.

    Thanks,

    Brian

    1. Jul 18, 2006

      Brian,

      It looks as the The Serverside have removed the article (or you need to log in to see it). Google has cached it though. This may also become stale in time....

      Cheers,
      Nick

    2. Sep 07, 2006

      This explains the permanent generation space option nicely.

  5. Sep 10, 2007

    JBoss' environment variables are configured in run.conf, not run.sh, at least for 4.2.1

  6. Nov 05, 2007

    Hi all,

     Memory settings via tomcat commands seem do not work with Jira 3.11.

    The following error is returned 

    E:\Jira\JIRA-Enterprise-3.11\bin>tomcat5 //US//JIRA --JvmMs 256 --JvmMx 256
    [2007-11-05 09:58:52] [402  prunsrv.c] [error]
    The system cannot find the file specified.
    [2007-11-05 09:58:52] [1246 prunsrv.c] [error]
    Load configuration failed

    It works fine via Registry settings. 

     Any idea?

    Thanks,

    1. Nov 05, 2007

      You can figure out the service name via regedit, via HKEY_LOCAL_MACHINE -> SOFTWARE -> Apache Software Foundation -> Procrun 2.0. At this branch it won't be listed as JIRA, but rather JIRA2934932 or something, and you can substitute this to your command line. (Would be useful for scripting). Eg.

      E:\Jira\JIRA-Enterprise-3.11\bin>tomcat5 //US//JIRA2934932 --JvmMs 256 --JvmMx 256

    2. Nov 20, 2007

      JIRA service installed by the exe installer or thought command "service install" is named JIRA<set of digits>

      In the above example you should execute:

      tomcat5 //US//JIRA<set of digits> --JvmMs 256 --JvmMx 256

      You can find the JIRA service name by clicking it twice in MMC Service

  7. Mar 05, 2008

    Is 1024 maximum setting for this?

    We got an error when we tried to increase memory settings over that, but I am not sure if that depends on how much physical memory the server has, on operating system (Windows 2003 Server) or it is JDK limitation.

    Timo Riikonen

    Accenture

  8. Jul 25, 2008

    In the "Check available memory" section, the "Java VM Memory portion of the "System Info" display contains:

      Total Memory =-259MB,    Free Memory = 72 MB,   User Memory = 167 MB,

    and the memory graph shows 27% Free.

    In the paragraph that follows, which seems to be describing these statistics, there of values of 650Mb (maximum) and 256Mb (minimum), and 543 MB (reserved) and 310Mb (actually in use) mentioned.

    Am I correct in thinking that of these two sets of numbers, one (probably the second) is wrong?

    1. Dec 29, 2010

      Anonymous

      Glad I'm not the only.

  9. Feb 20, 2009

    How can i get the values for "Free Memory" and "% Free" from the server console running JIRA / Confluence (Linux, Tomcat) instead of logging in to the browser-based Administration interface?

    That would make it a whole lot easier writing a Nagios probe to monitor these values. Otherwise it would be kind of hard to script an automatic admin login, just to parse these values out of the HTML of the admin webinterface.

    Thanks for hints

    1. May 25, 2009

      Anonymous

      We do this with SNMP. There are some helpful articles on the web that can lead you by the hand through the process, for example: http://www.ilikespam.com/blog/monitoring-the-jvm-with-snmp-mrtg

  10. Sep 18, 2010

    Anonymous

    Hi All,

    there is one problem with current startup scripts running Jira with Linux + OpenJDK.

    I use CentOS 5.4. java -version says following:

    java version "1.6.0_0"
    OpenJDK Runtime Environment (IcedTea6 1.6) (rhel-1.11.b16.el5-i386)
    OpenJDK Client VM (build 14.0-b16, mixed mode)
    java version "1.6.0_0"

    OpenJDK Runtime Environment (IcedTea6 1.6) (rhel-1.11.b16.el5-i386)

    OpenJDK Client VM (build 14.0-b16, mixed mode)

    Under OpenJDK Perm size should be set with -XX:PermSize=<size> option instead of -XX:MaxPermSize= like IBM VM.

    So if I just run Jira with default scripts I face out of memory error with only 30 issues.

    I used following workaround for this problem: at file [JIRA_HOME]/bin/setenv.sh at line 43 add following text:

    JAVA_OPTS="-XX:PermSize=$

    Unknown macro: {JIRA_MAX_PERM_SIZE}

    $

    Unknown macro: {JAVA_OPTS}

    "

    If Jira development is going to support systems with OpenJDK I think this information should help them.

    Best regards,

    Kirill

  11. Dec 07, 2010

    Anonymous

    The link to "[JIRAKB:Causes of OutOfMemoryErrors] page." is broken.

  12. Dec 07, 2010

    Anonymous

    On 64-bit systems the registry path is:

    HKEY_LOCAL_MACHINE -> SOFTWARE -> Wow6432Node -> Apache Software Foundatino -> etc.

  13. Sep 19, 2011

    I'm trying to change the jvm.dll to a 64bit JVM dll, but after doing this the service fails. Any idea how to make the service to run with a 64bit JVM?

  14. Jan 19, 2012

    Edit: pardon me, I've focused on the Java Options field and completely missed the two fields below where I can do the task easily. Sorry.

    Section "Setting Properties for Windows Services via Command Line", step 6, actually doesn't say how to increase JIRA memory. I guess I should add something like -Xmx512m if I want to increase memory to 512 MB? Or do I need to set Xms too? Or is it -XX:MaxPermSize that I need to set?