Expansion and contraction | Creating multiple caches

6.5 Using shared classes


WAS V6.1 offers the ability to share classes among VMs. The IBM JVM allows the sharing of system and application classes between VMs by storing and dynamically updating them in a cache in shared memory. Class sharing reduces virtual memory footprint and startup time for subsequent VMs started after the cache has been created.

Startup time is decreased because classes are loaded from memory rather than from disk. The shared class cache is independent of any active VM and persists beyond the lifetime of the VM. The usage of shared classes is completely transparent because the cache is dynamically updated and no restrictions are placed on the VMs that utilize shared classes.

Important: For a detailed discussion about using shared classes, including usage examples, refer to Shared Classes.

Shared classes are particularly useful on servers that use more than one VM that are running similar code and where VMs frequently start up and shut down. The maximum theoretical cache size is 2 GB, but the actual limit is dependent upon the amount of available virtual address space. This space is shared with the Java heap, so increasing the size of the heap will reduce the size of shared class cache that can be made.

Use shared classes only if the following criteria are met:

Note: Use care if runtime byte code modification is used. Refer to Java User's Guide for more information about shared classes and runtime byte code modification.