Java 2 SDK for Solaris Developer's Guide

Exact Garbage Collection

The Java 2 SDK for Solaris features exact garbage collection. Exact garbage collection increases performance by enabling a wider range of garbage collection techniques than conservative systems allow.

The Java 2 SDK for Solaris uses an efficient generational garbage collector. This efficiency produces significantly better performance for many applications. Generational garbage collection examines a subset of objects allocated for reclamation. The garbage collector selects a subset based on the age of the objects where younger generations of objects are examined more often than older ones. This subsetting works because in Java programs, recently created objects are more likely candidates for collection than older objects. This technique provides the added benefit of shorter pauses for garbage collection, because young-generation collections are usually much shorter than full collections.

To achieve this added performance, the entire system must support exact collection, including user-written native code. Fortunately, the Java Native Interface (JNI) allows an implementation that is compatible with exact collection. Because Java 2 SDK for Solaris provides such an implementation, native code written using the JNI works seamlessly with the Java 2 SDK for Solaris VM.

Direct Pointers

Java 2 SDK for Solaris exact garbage collection uses direct pointers for objects, rather than handles. Using direct pointers decrease memory consumption, speed allocation, and increase system performance by eliminating one level of indirection in accessing objects.

Double-Word Alignment (longs and doubles) to 8-Byte Boundaries in the Heap

Double-word values are now aligned to 8-byte boundaries in the heap. This alignment improves the performance of both native code and JIT-compiled Java code while ensuring correctness of volatile double-word values on SPARC systems. However, if your application allocates and retains many small objects, you might need to increase your heap size(s) slightly, as these objects are allocated in multiples of 8 bytes, increasing memory usage.