5.3.2 IBM J9 JVM
On IBM platforms, and some others, an IBM Java Virtual Machine is implemented that offers extra features and enhanced performance beyond the standard reference JVM. The IBM Java Virtual Machine is tuned to make the most of the platform and uses a combination of Just-In-Time (JIT) compilation and interpretation, based on the expected execution overheads of both compared to the number of executions and underlying code performance. The IBM implementation shipped for use by WebSphere Application Server is called J9, and it ships in both 64-bit and 32-bit versions; see Figure 5-4.
Figure 5-4 AIX 32-bit memory management
For AIX, all processes are split into 256 MB segments that have specific uses. For a 32-bit process that has only 16 segments (to access 4 GB of address space), a number of these (11) are normally used for shared memory, and one in particular (segment 2) contains the process heap and stack (heading towards each other) and any private shared object data segments. A typical appserver and JVM usually have some native code libraries accessed via the Java Native Interface (JNI) that would take up space in this segment.
From 1.4 JVM onward, IBM made use of some of the shared memory segments to support a large heap for Java applications without the use of the AIX LDR_CNTRL environment variable. However, even with this, the heap is limited to just over 3 GB of RAM. In this large model, the user stack remains in segment 2, but the user heap moves to start in segment 3 and make use of a number of the shared memory segments (see Figure 5-5). For small applications, this new layout may be sufficient.
If your application can leverage a large heap size, or if it requires high precision calculations that can leverage extra registers, then 64-bit JVM is preferable.
Figure 5-5 AIX 32-bit memory management, JVM 1.4
With the 64-bit AIX processes, such as supported by the IBM 64-bit J9 JVM, the first 4 GB of address space is reserved for compatibility with 32-bit code, but up to 448 PB of user heap address space is available to the process. So, although 256 MB segments are still in use, the large numbers of them available makes the previous issue irrelevant with current systems using less than a few TB of RAM; see Figure 5-6.
Figure 5-6 AIX 64-bit memory management
The IBM J9 Java 5 JVM was developed with features to best exploit the AIX platform and offer benefits to Java code outside of platform-specific features. Understanding how it works enables it to be used to best effect for enhanced performance with reduced resource utilization.
The Java Virtual Machine is just that, a virtual machine. That is, to the code that it runs it seems to be a real machine with its own instruction set, execution engine, thread management, memory management, and so on. But to the real host machine, it is just a single process.
Most Java Virtual Machine Runtime implementations consist of the Java byte code execution engine in the JVM itself, the Just-In-time (JIT) compiler, and the garbage collector; see Figure 5-7. All of these elements have been enhanced in the IBM J9 implementation that underpins the WebSphere Application Server Version 6.1 and above on AIX.
Figure 5-7 WebSphere Application Server inside the JVM on AIX