Java virtual machine implementation checklist

You can review the Java™ virtual machine implementation checklist for specific recommendatons.

Table 1. JVM implementation recommendations
Recommendation Section Dev Prod Comments
JVM Version JVMs: supported configuration C C Make sure you install the system on certified JVM versions and levels.
Add -showversion to the JVM command line Java version R R During the JVM startup, the JVM version and mode are displayed. This simple step helps eliminate cases where the wrong JVM is used.
Verbose GC Statistics JVM recommendations: garbage collection statistics NA C Enable verbose GC statistics collection. Understanding the "health" of GCs for each JVM is critical for performance.
Monitor for Paging Memory and paging C C The JVM heap must be resident in memory. Performance degrades noticeably if the OS has to page portions of the heap out to disk.
Monitor for OutOfMemory exceptions OutOfMemory exceptions C C OutOfMemory exceptions can cause unpredictable application behaviors. As a safety measure, stops the JVM when it catches an OutOfMemory exception.
For HotSpot JVMs        
For Sun JDK, run with -XcompressedOops if you do not need heaps up to 32GB. This will provide better memory utilization, increase performance, and reduce the overall footprint, as well.        
IBM® J9 JVM
For IBM JDK, use -Xcompressedrefs option.       In IBM JDK 1.7, the -Xcompressedrefs option is enabled by default.
For IBM JDK 1.6 SR12, running with -Xcompressedrefs results in lower performance and throughput. For now, IBM suggests running without the -Xcompressedrefs option.        
JVM VM modes Virtual machine mode C C  
For HotSpot JVMs running WebLogic, set -XX:MaxPermSize=768m Permanent generation C C The default permanent generation space setting is too small for Oracle and HP JVMs. If you don't increase this setting, the JVM fails and throw a cryptic java.lang.OutOfMemory exception.
For HP JVMs, ensure amount of free space in the Old Generation is larger than the combined size of the Eden plus the occupied space in the survivor space. Young generation guarantee C C Sun and HP JVMs implement a conservative policy called the Young Generation Guarantee, specifying that the amount of free space in the Old must be larger than the eden and survivor space on the chance that every object is still alive after the GC. If the Old free is too small, the JVM reverts to Full GCs. Young Generation Guarantee is valid only for serial collector from JDK 1.5 (and later).

Customers migrating from JDK 1.3.1 may have to increase their overall heap size or decrease the eden.

Heap Size Starting recommendations C C Configuring the JVM Heap correctly is not only critical for performance but also for availability. If the heap is sized too big, the GC pauses could be very long. If the heap is larger than physical memory, the system could "thrash". If the heap is too small, the JVM could experience OutOfMemory exceptions.