BEAST 2

Increasing Memory Usage

Increasing the Memory available to BEAST and the utility programs

If an application fails to launch with the following error:

"java.lang.OutofMemoryError: Java heap space"

The solution is to tell Java to use more memory when loading the program. How this is done depends on which version of the program you are using.

Mac OS X version

  1. Right-click (or Control-click if you are using a 1-button mouse) on the BEAST application icon:

Rightclick

Now go into the folder called “Contents” and find the file called ‘info.plist’. Double-clicking this file should open it in an application called “Property List Editor” (this can be found in your Developer/Applications/Utility folder if it doesn’t open automatically, but you will need to have installed the Developer Tools). In this program open the section called “Java” and edit the string labelled “VMOptions”:

Plist

 

This will have the format: -Xss256M -Xmx8G, where the -Xmx and -Xss commands determine the maximum and starting amount of memory that java is provided (the M after each number specifies that it is in megabytes, G for gigabytes). You can now increase the -Xmx option to something larger. Then save the “info.plist” file, close the folders and try running the program again.

Note: if you don’t have the ‘Property List Editor’ installed, you can load the ‘info.plist’ into a text editor – find the string that looks like the one above and edit it.

This technique can also be used to increase the memory for the other BEAST-related programs such as LogCombiner, TreeAnnotator and Tracer.

If you are using the command-line version of BEAST on Mac OS X, then see the next section.

UNIX and Linux versions

A solution to this problem is to run BEAST via the command line using the following command:

java -Xss256M -Xmx8G -jar lib/launcher.jar

The -Xmx and -Xss commands determine the maximum and starting amount of memory that java is provided (the M after each number specifies that it is in megabytes, the G gigabytes). Try increasing the -Xmx number to something larger.

In many cases, BEAST and the other programs will be run by calling the executable shell scripts in the BEAST.v1.4/bin directory. If you edit these, you will see a java command similar to the above and you can adjust the memory usage as required.

Windows version

This is more difficult because the Windows executables are not editable. However the launcher.jar files can be found in the BEAST v1.4/lib folder and you can use the command in the UNIX version, above, to run BEAST using the command line:

java -Xss256M -Xmx8G -jar lib/launcher.jar

or you can edit the batch files in the `BEAST\bat` directory.

Increasing stack size available to BEAST and the utility programs

If an application fails to launch with the following error:

Caused by: java.lang.StackOverflowError

you want to increase the stack size by update the -Xss value, e.g. from -Xss=256m to -Xss1G at any of the places indicated above.

Bayesian evolutionary analysis by sampling trees

Served through Jekyll, customised theme based on the twentyfourteen wordpress theme.