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
From the Close Programs Dialogue (Press ctrl-alt-delete), select the Performance tab:

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.
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.
21 Comments
Hide/Show CommentsSep 15, 2005
Sven Breidenstein
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.
Oct 05, 2005
Simon Taylor
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.
Apr 06, 2006
Darren Bell
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.
Apr 10, 2006
Nick Menere
Darren, this can be done through the Web Console:
Servers > Application Servers > server_name > Process Definition > Java Virtual MachineYou can then define the Initial Heap size and the Max heap size.
You will need to bounce the server.
Cheers,
Nick
Jul 18, 2006
Brian Sutton
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
Jul 18, 2006
Nick Menere
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
Sep 07, 2006
Mulyadi Oey
This explains the permanent generation space option nicely.
Sep 10, 2007
Jeremy Largman [Atlassian]
JBoss' environment variables are configured in run.conf, not run.sh, at least for 4.2.1
Nov 05, 2007
Abdelkader Boumediene
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,
Nov 05, 2007
Peter White
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.
Nov 20, 2007
Bogdan Dziedzic
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
Mar 05, 2008
Timo Riikonen
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
Jul 25, 2008
Dan Gawarecki
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?
Dec 29, 2010
Anonymous
Glad I'm not the only.
Feb 20, 2009
Daniel Zahn
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
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
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=$
$
"
If Jira development is going to support systems with OpenJDK I think this information should help them.
Best regards,
Kirill
Dec 07, 2010
Anonymous
The link to "[JIRAKB:Causes of OutOfMemoryErrors] page." is broken.
Dec 07, 2010
Anonymous
On 64-bit systems the registry path is:
HKEY_LOCAL_MACHINE -> SOFTWARE -> Wow6432Node -> Apache Software Foundatino -> etc.
Sep 19, 2011
Sudheer Sangunni
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?
Jan 19, 2012
Borek Bernard
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-Xmx512mif 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?Add Comment