Intel 170 Servers Benutzerhandbuch

Seite von 368
Fortunately, it is not too difficult to come up with parameter values which will provide good performance.
If you are moving an application from the Classic VM to IBM Technology for Java, you can use a tool
like DMPJVM or verbose GC to determine how large the heap grows when running your application.
This value can be used as the maximum heap size for 64-bit IBM Technology for Java; in 32-bit IBM
Technology for Java, about 75% of this value is a reasonable starting point.  For example, if your
application’s heap grows to 256 MB when running in the Classic VM, try setting the maximum heap size
to 192 MB when running in the 32-bit VM.  The initial heap size can be set to about half of this value –
96 MB in our example.  These settings are unlikely to provide the best possible performance or the
smallest memory footprint, but the application should run reasonably well.  Additional performance tests
and tuning could result in better settings.
If your application also runs on IBM VMs on other platforms, such as AIX, then you might consider
trying the GC parameters from those platforms as a starting point when using IBM Technology for Java
on i5/OS.
If you are testing a new application, or aren’t certain about the performance characteristics of an existing
application running in the Classic 64-bit VM, start by running the application with the default heap size
parameters (currently an initial heap size of 4 MB and a maximum of 2 GB).  Run the application and see
how large the heap grows under a typical peak load.  The maximum heap size can be set to this value (or
perhaps slightly larger).  Then the initial heap size can be increased to improve performance.  The optimal
value will depend on the application and several other factors, but setting the initial heap size to about
25% of the maximum heap size often provides reasonable performance.
Keep in mind that the maximum heap size for the 32-bit VM is 3328 MB.  Attempting to use a larger
value for the initial or maximum heap size will result in an error.  The maximum heap size is reduced
when using IBM Technology for Java’s “Shared Classes” feature or when files are mapped into memory
(via the java.nio APIs).  The maximum heap size can also be impacted when running large numbers of
threads, or by the use of native code running in i5/OS PASE, since the memory used by this native code
must share the same 32-bit address space as the Java VM.  As a result, many applications will have a
practical limit of 3 GB (3072 MB) or even less.  Applications with larger heap requirements may need to
use one of the 64-bit VMs (either IBM Technology for Java or the Classic VM).
When heap requirements are not a factor, the 64-bit version of IBM Technology for Java will tend to be
slightly slower (on the order of 10%) than 32-bit with a somewhat larger (on the order of 70%) memory
footprint.  Thus, the 32-bit VM should be preferred for applications where the maximum heap size
limitation is not an issue.
7.4 Classic VM (64-bit)
The 64-bit Classic Java Virtual Machine continues to be supported in V6R1, though most applications
should begin migrating to IBM Technology for Java to take advantage of its performance benefits.  The
integration of the Classic VM into i5/OS provides some unique features and benefits, although this can
result in some confusion to users who are familiar with running Java applications on other platforms.
Some of the performance-related features you may need to be aware of are described below.
JIT Compiler
Interpreting the platform-neutral bytecodes of a Java class file, bytecode by bytecode, is one valid and
robust way to execute Java object code; it is not, however, the fastest way.  To approach optimal Java
IBM i 6.1 Performance Capabilities Reference - January/April/October 2008
©
 Copyright IBM Corp. 2008
Chapter 7 - Java Performance
128