How to Change the Java Parameters for Rainbow

From Okapi Framework
Jump to: navigation, search

In some cases, like when processing very large files, you may need to tweak the Java VM parameters when running Rainbow. For example, you may want to increase the amount of memory the Java VM can use.

You can find a description of the Java launch parameters by simply calling java without parameters. Note that any options starting with -X is specific to your Java system.

To change the minimum and maximum memory size for the Java VM however, the parameters are usually the same: -XmsNNN and -XmxNNN where NNN is a multiple of 1024 greater than 1MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. For example: -Xms16m will allocate 16MB to the VM.

Windows

The Windows distribution uses Launch4J to create an executable for Rainbow. to change its default parameters you must create a file named rainbow.l4j.ini in the same directory as rainbow.exe (the directory where you have installed the tools).

You can then simply put the parameters in that INI file. Make sure parameters are separated by spaces or line-breaks. Comments are any line with a # at the beginning.

For example to set the VM memory pool to 10MB, add -Xms10m:

# Set the VM initial memory to 10MB
-Xms10m

Linux

Go to the directory where you have installed the tools. There, you will see the file rainbow.sh. This is where the Java launch parameters can be changed. Open the file and modify the script as needed.

For example to set the VM memory pool to 10MB, add -Xms10m:

#!/bin/bash
cd "`dirname $0`"
java -Xms10m -jar lib/rainbow.jar $*

Macintosh

Go to the directory where you have installed the tools. From there go to Rainbow.app/Contents/MacOS. There, you will see the file rainbow.sh. This is where the Java launch parameters can be changed. Open the file and modify the script as needed.

For example to set the VM memory pool to 10MB, add -Xms10m:

#!/bin/bash
cd `dirname $0`
java -d64 -Xms10m -XstartOnFirstThread -jar ../../../lib/rainbow.jar