This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.
This documentation relates to an early version of Confluence.
View this page in the current documentation or visit the current documentation home.

Fix 'Out of Memory' errors by increasing available memory

All Versions
Click for all versions
Confluence 2.0 to 2.5 Documentation

Index

I am getting Out of Memory errors, how can I allocate more memory to tomcat?

Since the default memory setting usually is around 64 or 128MB (256MB in Confluence 2.2 and later), you might have to adjust the settings to run a bigger Confluence instance with sufficent memory. Users running Confluence as a service please refer to the Start Confluence automatically on Windows as a Service page. For users running Tomcat standalone, you will have to change the following settings:

Confluence 2.2 or later (Tomcat 5.5)

Do not set your memory using CATALINA_OPTS this is overridden by JAVA_OPTS.

On Linux

  • In the unpacked Confluence standalone directory, edit the file bin/setenv.sh
  • Edit the line beginning with JAVA_OPTS= substituting new values for -Xms (starting memory) and -Xmx (maximum memory)
  • Leave the rest of the options in that line unchanged

An example of a minimal setting for a large system - max heap size is set to 1Gb :

JAVA_OPTS="-Xmx1024m $JAVA_OPTS -Djava.awt.headless=true "

On Windows

  • In the unpacked Confluence standalone directory, edit the file bin/setenv.bat
  • Edit the line beginning with set JAVA_OPTS= substituting new values for -Xms (starting memory) and -Xmx (maximum memory)
  • Leave the rest of the options in that line unchanged

Confluence 2.1 and earlier (Tomcat 4.0)

On Linux
Edit the file $TOMCAT_HOME/bin/ startup.sh and insert the following line, substituting for the desired value, eg. Bash Shell:
export CATALINA_OPTS="-Xms(min heap)m -Xmx(max heap)m"

The line you add should go just before the line starting exec "$PRGDIR...

On Windows
Edit the file $TOMCAT_HOME\bin\ startup.bat and insert or alter the following line, substituting for the desired values:
set CATALINA_OPTS=-Xms(min heap)m -Xmx(max heap)m

For example if you want to allocate a minimum heap size of 256MB and a max heap size of 512MB you will have to write the following on Windows:
set CATALINA_OPTS=-Xms256m -Xmx512m

The line you add should go just before the line starting call "%EXECUTABLE%"...

If you are running tomcat 5.5 via tomcat.exe, you can update the heap size by running tomcatw.exe and setting the required values via the Java tab.

Other Notes

On OS X
If you are using the 'serveradmin start appserver' to start and stop tomcat, then you will need to update /usr/share/servermgrd/bundles/servermgr_appserver.bundle/Contents/Resources/run.sh


Permanent Generation Size 

If you get the error message: java.lang.OutOfMemoryError: PermGen space this means that you have exceeded Java's fixed 64Mb block for loading class files. You will need to add the argument -XX:MaxPermSize=128m to CATALINA_OPTS, in addition to any argument you use to set the heap size.

Please refer to this link for more information.

RELATED TOPICS

Managing Application Server Memory Settings
Application Server Configuration
FAQ Home
Tomcat JVM options and Modify the Default JVM Settings
Logging A Thread Dump

Labels

troubleshooting-faq troubleshooting-faq Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.