This documentation relates to an earlier version of Bamboo.
View

Unknown macro: {spacejump}

or visit the current documentation home.

I am getting 'Out of Memory' errors. How can I allocate more memory to Bamboo?

Since the default memory setting usually is 256MB in Bamboo, you might have to adjust the settings to run a bigger Bamboo instance with sufficient memory.

Linux の場合

  • In the unpacked Bamboo Standalone directory, edit the file bamboo.sh
  • Edit the line beginning with RUN_CMD= substituting new values for -Xms (starting memory) and -Xmx (maximum memory)
  • Leave the rest of the options in that line unchanged.

Here is an example of a minimal setting for a large system (maximum heap size is set to 768 megabytes):

RUN_CMD="java -server -Xms512m -Xmx768m -XX:MaxPermSize=256m -Djava.awt.headless=true -classpath $CLASSPATH -Dorg.mortbay.xml.XmlParser.NotValidating=true -Djetty.port=8085 com.atlassian.bamboo.server.Server 8085 ./webapp /"

Windows の場合

Bamboo uses a wrapper to start, either as a service or in a console.

  • The wrapper reads the configuration from the wrapper.conf file, which is found in BAMBOO_INSTALL/conf. (The parameters are documented inside the file.)
  • Edit the -Xms value to increase your Bamboo memory.

その他

Allocating too much memory to your JVM Heap can also cause OutOfMemory Errors.

The error java.lang.OutOfMemoryError: unable to create new native thread occurs when the operating system is unable to create new threads. This is due to the JVM Heap taking up the available RAM. Big heaps take away from the space that can be allocated for the stack of a new thread.
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.
The stack size can be changed with the following (example) parameter:

"-Xss512k"

Please refer to the following guide as a reference for JVM tuning: http://goobsoft.homeip.net/Wiki.jsp?page=JavaDebianTuning.

Allocating large maximum heap and low minimum heap can slow down Bamboo

If Xmx is much (much) larger than Xms Java will spend long periods of time in garbage collection to reach the Xms goal. This will slow down Bamboo performance.

If you need to increase Xmx also increase Xms as well to avoid that scenario.

Getting a memory dump on OOM errors

 Passing in -XX:+HeapDumpOnOutOfMemoryError will make the JVM create a memory dump, when it runs out of memory. To do this:

Linux の場合

  • In the unpacked Bamboo Standalone directory, edit the file bamboo.sh
  • Edit the line beginning with RUN_CMD= and add -XX:+HeapDumpOnOutOfMemoryError to the line
  • Leave the rest of the options in that line unchanged.

For example

RUN_CMD="java -server -XX:+HeapDumpOnOutOfMemoryError -Xms512m -Xmx768m -XX:MaxPermSize=256m -Djava.awt.headless=true -classpath $CLASSPATH -Dorg.mortbay.xml.XmlParser.NotValidating=true -Djetty.port=8085 com.atlassian.bamboo.server.Server 8085 ./webapp /"

Windows の場合

Bamboo uses a wrapper to start, either as a service or in a console.

  • The wrapper reads the configuration from the wrapper.conf file, which is found in BAMBOO_INSTALL/conf. (The parameters are documented inside the file.)
  • Add an additional -XX:+HeapDumpOnOutOfMemoryError parameter to the wrapper and save changes.

(warning) You need to restart the Bamboo server for changes to take affect. If you have any elastic agents running, ensure that they are shut down before you restart the Bamboo server. If you do not shut down your elastic instances before restarting, they will continue to run and become orphaned from your Bamboo server.

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 and increase the memory.

  • JDK 1.4 does not provide information as to why the OutOfMemory error occurred.
  • JDK 1.5 and above are recommended as they provide a description of the error as in the above example.
  • ラベルなし