|
Boosting Java Performance
Hey, David:
Do you have any tips on improving the performance of Java programs on the iSeries? All
of the Java programs that I have created ran a lot faster on my PC.
-- Scott
You didn't mention the types of programs that you are trying to run. I suspect that
they do not access a database. The iSeries is primarily a business machine, and
performance of business applications is generally governed by database and disk I/O
performance. Where iSeries Java programs excel is with database intensive applications.
Here are some things that you can do to improve the performance of Java programs on your
system:
- Install the latest Java Development Kit (JDK)
- Make sure that you have the latest cumulative and group PTFs
- If you use the iSeries Java Toolbox, use the native optimizations
- Pre-compile your Java programs using the Create Java Program (CRTJVAPGM) command
To address item one, order and install the latest JDK. The latest JDK for V4R4 systems is
1.2, for V4R5 and V5R1 systems, order the 1.3 JDK. Use the Licensed Program menu (GO
LICPGM) and select option 10 to determine what JDK you are using. The IBM Web page on post-release
JDKs describes the steps to follow when upgrading your JDK. On releases prior to V5R1,
the 1.3 JDK does not automatically become the default, so you will have to set an
environment variable when running and compiling your Java programs. For example:
java -Djava.version=1.3 mypackage.MyClass.java
For item two, make sure you have the latest cumulative and group PTFs installed. You can
use IBM's iSeries support Web page to
review the Preventive Service
Planning (PSP) information, which includes information about available group PTFs.
When you have identified the PTFs you need to order, you can use the Internet PTF Download
(iPTF) facility.
The third item requires that you have the proper version of the iSeries Java Toolbox
installed for your release and that you add the native extensions to your classpath. IBM
provides information about native optimization in the JTOpen
FAQ. You might also want to review IBM’s JDBC FAQ, which
goes into more detail. You will also have to specify the proper JDBC URL in your
applications, which will look like this:
("jdbc:db2:system", "user", "password")
Finally, to address item four, you need to pre-compile your Java programs. Use the Create
Java Program (CRTJVAPGM) command, CLSF(‘/path/ClassFile.CLASSorJAR’) OPTIMIZE(40). This
last tip will only improve performance for classes loaded by the default class loader.
-- David
|