Skip to content
Micha Niskin edited this page Jan 19, 2015 · 16 revisions

On Unix machines JVM options are set via the BOOT_JVM_OPTIONS environment variable:

export BOOT_JVM_OPTIONS='-Xmx2g -client'

If you're using the boot.exe executable for Windows you must create a boot.l4j.ini file containing your desired options as described in the launch4j documentation.

Faster Startup

You can cut down the initial startup time with these options:

-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xverify:none

More Heap Space

If you're running out of heap space you can add an option to increase the maximum heap space for the JVM:

-Xmx2g

PermGen Errors

Boot will start multiple Clojure runtimes in Pods. Each one will create a lot of classes, each of which will occupy space in the PermGen (Permanent Generation) of the JVM garbage collector. This means that this space will never be reclaimed when the pod falls out of scope. If you're getting PermGen allocation errors you can try adding these options:

-XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled

The -XX:MaxPermSize option was removed in Java 1.8, along with PermGen itself.

Micha's Setup

This is how I have my system configured.

OSX

$ uname -mrsv
Darwin 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
$ java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
$ echo $BOOT_JVM_OPTIONS
-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx2g -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xverify:none

Linux

$ uname -msrv
Linux 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64
$ java -version
java version "1.7.0_72"
Java(TM) SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)
$ echo $BOOT_JVM_OPTIONS 
-Xmx2g -client -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xverify:none
Clone this wiki locally