Confluence 2.7 Temp Archive : Fix 'Out of Memory' errors by increasing available memory
This page last changed on Dec 09, 2007 by mjensen.
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.6 with Tomcat 5.5Do not set your memory using CATALINA_OPTS, because this is overridden by JAVA_OPTS. On Linux
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
Other OutOfMemoryErrors
OutOfMemoryError: unable to create new native threadThis error occurs when the operating system is unable to create new threads. This is due to the JVM Heap taking up the available RAM.
For Linux the maximum heap size of the JVM cannot be greater than 2GB. If you only have 2GB RAM in your server, it is not recommended to set the Max size of the JVM that high. To fix this problem, you should reduce the size of your JVM Heap and also the size of the stack per thread. "-Xss512k" Please refer to this guide as a reference for JVM tuning. OutOfMemoryError: GC overhead limit exceededThis error indicates that the JVM took too long to free up memory during its GC process. This error can be thrown from the Parallel or Concurrent collectors.
This kind of OutOfMemoryError can be caused if your java process is starting to use swapped memory for its heap. This will cause the JVM to take a lot longer than normal to perform normal GC operations. This can eventually cause a timeout to occur and cause this error. To overcome this issue, you need to make sure that all processes can't allocate more memory than there is system memory. In practice this is impossible to do for all processes. At a minimum you should make sure that all your jvm's do not have a total maximum memory allocation than your normally available system memory. Please refer to this guide for more information. On OS XIf 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 SizeIf 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 TOPICSManaging Application Server Memory Settings |
![]() |
Document generated by Confluence on Dec 20, 2007 19:02 |