JVM Options

The Java Virtual Machine (JVM) is a complex piece of software. It is designed to run a huge variety different programs. As such, its default configuration is not optimised for the particular needs of evolutionary computation. This section lists some of the JVM options that you can tweak to try to achieve better performance.

Server VM

The Sun JVM provides two modes of operation, one optimised for client applications (the default) and one for server applications. The server VM takes marginally longer to start up but provides substantially better performance for long-running processes and is therefore a better choice for most evolutionary algorithms. The server VM is enabled using the -server switch.

Garbage Collection

Evolutionary algorithms create many short-lived objects. Modern JVMs, with their generational garbage collectors, are typically well tuned for this usage pattern. However, you may find that by modifying the settings you are able to improve throughput.

Garbage collectors make a trade-off between overall throughput and pause time. For evolutionary algorithms we typically want to maximise throughput, even at the expense of introducing noticeable pauses in the program's execution. What is most important is how soon the program completes, not how smoothly it runs.

You can get information on what the garbage collector is doing by starting the JVM with the -verbosegc switch. If you find that the program is spending a lot of time collecting garbage, it may be because it is short of memory. If you have sufficient RAM, increasing the maximum size of the Java heap (using the -Xmx switch) may improve things.

Alternative JVMs

Sun Microsystems is not the only provider of virtual machines for Java. If your platform is supported, you may also have the option of using a JVM from BEA, IBM or some other third party. These virtual machines have different performance characteristics and different garbage collector implementations. If you have tried everything else and still need something faster, you may find that a different JVM will perform better. Then again, it may not.