This page last changed on Jun 18, 2007 by rosie@atlassian.com.

The minimum and maximum JVM heap space allocated to the application server affects performance. Confluence administrators may wish to modify this value from the defaults depending on their server load. This document only provides guidelines rather than rules, so administrators optimising for performance should use this document as a starting point only.

Testing For Optimum Memory Settings

Bigger is not always better for heap size. When optimising memory settings, consider starting by setting the minimum heap size to 1/4 the available physical memory on the server and setting the maximum to 1/2 of the maximum heap. Avoid setting the minimum and maximum to be the same since server load is normally variable. Being able to use less memory under low load results in slightly improved performance as garbage collections can be made smaller.

Testing Resources

  • Enable the verbosegc JVM parameter to assist in determining the memory size that minimises overall garbage collection
  • Use Page Request Profiling to gauge end-user performance

Determine Minimum Memory
Experiment with setting a lower minimum such as 1/10 of the maximum heap. Identify how much memory is required while under minimum load and set the minimum to that value. It is important to have Confluence use the minimum memory necessary, because garbage collection performance is dependent on the memory usage. Having an unnecessarily high minimum memory setting will degrade performance during GC operations.

Determine Maximum Memory
Experiment with different maximum memory settings with the verbosegc JVM parameter enabled to determine GC performance. Memory usage is most likely to be maximised under peak load, and when creating a site XML backup. Confluence memory may visibly increase while it is generating an XML backup.

  • If you normally perform manual XML site backups on your server, test your maximum memory requirements by performing a site XML backup while the server is under maximum load
  • If you do not create manual XML site backups, simply monitor the server while under maximum load

The maximum memory should be the total memory while in this state plus a buffer of at least 15%, taking into account how your garbage collection performs. Never set maximum memory to a value above 85-90% of the available physical server memory as this results in disk paging. Always leave 10-15% of available physical server memory unallocated to allow for OS background processes.

Applying Memory Settings

Users of the EAR/WAR version set their memory in their application server. For Confluence Standalone, the heap space is set in the Confluence install directory.

  • Windows users edit .../bin/setenv.bat
  • Other OS users edit .../bin/setenv.sh

The relevant parameter is

JAVA_OPTS="-Xms128m -Xmx256m ... "

Where -Xms is the minimum and -Xmx is the maximum memory available to Apache Tomcat.

Related Topics

Document generated by Confluence on Oct 10, 2007 18:49