travis-ci/travis-cookbooks — pull request #347 by headius (2014-07-24 06:33:22+00:00)
Title: Improved JRuby options.

Changes are as follows, with justification:

* --server to --client

--server is really only useful on long-running processes...longer
running than a test build. Tests are also a worst-case scenario
for optimization, since most code will only run once or a few
times. --client provides the fastest startup and shortest warmup
time with reduced long-run performance, making it a better choice
for test runs.

* Add -J-XX:TieredStopAtLevel=1

On 64-bit and newer JVMs, the -client and -server flags are no
longer honored. Instead, the JVMs either run server all the time
or a "tiered" compiler that combines -client and -server. This
flag forces that tiered compiler to only do client-level
optimization, equivalent to the fast-starting -client mode.

* Remove memory setting

It *is* true that the JVM itself defaults to a 64MB heap limit,
but JRuby already adjusts that to 500MB. This flag is actually
reducing available memory.

--

I believe these flags will work well on all recent JRuby versions
(within the last few years) and all Hotspot-based JVMs (OpenJDK,
Oracle, IcedTea) as far back as the 1.6 line.