Virtual Machine (VM) Versions

I have focused on the Sun VMs since there is enough variation within these to show interesting results. I have shown the time variation across different VMs for many of the tests. However, your main focus should be on the effects that tuning has on any one VM, as this identifies the usefulness of a tuning technique. Differences between VMs are interesting, but are only indicative and need to be verified for your specific application. Where I have shown the results of timed tests, the VM versions I have used are:

1.1.6

Version 1.1.x VMs do less VM-level work than later Java 2 VMs, so I have used a 1.1.x VM that includes a JIT. Version 1.1.6 was the earliest 1.1.x JDK that included enough optimizations to be a useful base. Despite many later improvements throughout the JDK, the 1.1.x VMs from 1.1.6 still show the fastest results for some types of tests. Version 1.1.6 supports running with and without a JIT. The default is with a JIT, and this is the mode used for all measurements in the book.

1.2

I have used the 1.2.0 JDK for the 1.2 tests. Java 2 VMs have more work to do than prior VMs because of additional features such as Reference objects, and 1.2.0 is the first Java 2 VM. Version 1.2 supports running with and without a JIT. The default is with a JIT, and this is the mode used for measurements labeled “1.2.” Where I’ve labeled a measurement “1.2 no JIT,” it uses the 1.2 VM in interpreted mode with the -Djava.compiler=NONE option to set that property.

1.3

I have used both the 1.3.0 full release and the 1.3 prerelease, as the 1.3 full release came out very close to the publication time of the book. Version 1.3 supports running in interpreted mode or with client-tuned HotSpot technology (termed “mixed” mode). Version 1.3 does not support a pure JIT mode. The default is the HotSpot technology, and this is the mode I’ve used for measurements labeled simply “1.3.”

HotSpot 1.0

HotSpot 1.0 VM was run with the 1.2.0 JDK classes. Because HotSpot optimizations frequently do not kick in until after the program has run for a little while, I sometimes show measurements labeled “HotSpot 2nd Run.” This set of measurements is the result from repeating the particular test within the same VM session, i.e., the VM does not exit between the first and second runs of the test.

Get Java Performance Tuning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.