Confluence Docs 2.10 : Fix Out of Memory errors by Increasing Available Memory
This page last changed on Dec 03, 2008 by mtaylor.
On this page: Error formatting macro: toc: java.lang.NullPointerException
Diagnosis and Common CausesThere are several reasons that out of memory exceptions can be thrown. Either the virtual machine Confluence is using has hit its allocated memory limit, the system on which Confluence is running has run out of physical and virtual memory, or Confluence is consuming too much memory. In the first case, you should modify the maximum heap size of the virtual machine, per the instructions in this document; in the second or third cases, the solution is to identify the culprit of the memory leak. For help determining which memory settings to choose, consult Managing Application Server Memory Settings. If you have not yet set your memory settings and your usage has increased, it's likely that you must set your memory, described below. If your usage patterns have not changed but you've added a plugin or done an upgrade, it's likely that there is a memory leak in a plugin.
To troubleshoot potential memory leaks, enter Plugin Support Mode. Take thread dumps during normal operations and during an outage, and submit this information in a support ticket. Determining Heap Errors Versus Permanent Generation Size (PermGen) ErrorsHeap space memory errors will contain only a java.lang.OutOfMemoryError. 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=256m to JAVA_OPTS, in addition to any argument you use to set the heap size. PermGen Space ParametersJAVA_OPTS="-Xms128m -Xmx1024m -XX:MaxPermSize=256m $JAVA_OPTS -Djava.awt.headless=true " Heap Space ParametersJAVA_OPTS="-Xms128m -Xmx1024m -XX:MaxPermSize=256m $JAVA_OPTS -Djava.awt.headless=true " Setting the Memory SettingsHow to set the heap or permanent generation memory depends on your distribution, platform, and how you start Confluence. First, figure out whether you have the war/ear version or the stand-alone. Then find your operating system, and finally look for how you start Confluence. Confluence War DistributionIf you are running the War distribution, consult your application server's documentation for how to set environment variables. If you are running Confluence WAR with Tomcat you would need to update <Tomcat install directory>/bin/ catalina.bat for Windows or catalina.sh for other OS. Confluence Stand-alone (zip or tar.gz distribution)If you are running Tomcat standalone, you can change the following settings.
Linux
An example of a minimal setting for a large system - max heap size is set to 1Gb : JAVA_OPTS="-Xms128m -Xmx1024m -XX:MaxPermSize=256m $JAVA_OPTS -Djava.awt.headless=true " WindowsStarting from the Bat File
Windows - Running as a Windows ServiceIf you are running Confluence as a Windows service, you can increase the memory using two ways. Edit the registry:Follow this step by step guide to edit the Windows Registry OR Run this command from the command line:tomcat6 //US//Confluence --JvmMs 1024 --JvmMx 1024 ++JvmOptions="-XX:MaxPermSize=256m"
OS XStarting from TomcatIf you are using the 'serveradmin start appserver' to start and stop tomcat, then update /usr/share/servermgrd/bundles/servermgr_appserver.bundle/Contents/Resources/run.sh. Starting from the shell script or "Run Confluence In Terminal Window.command"Follow the Linux instructions above. Confluence Installer Memory SettingsIf you are using the Evaluation Installer, use the instructions accordingly:
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. The size of the stack per thread can also contribute to this problem. The stack size can reduce the number of threads that can be created. 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. OutOfMemoryError: Requested array size exceeds VM limitThis error indicates that Confluence attempted to allocate an array that is larger than the Java heap size. More details regarding this error can be found here. RELATED TOPICSManaging Application Server Memory Settings |
![]() |
Document generated by Confluence on Dec 03, 2008 15:14 |