Java Language Performance Tips - IBM 170 Servers Manual

Intel power systems operating systems
Hide thumbs Also See for 170 Servers:
Table of Contents

Advertisement

does take advantage of programs created at optimization *INTERPRET. These programs require
significantly less space and do not need to be deleted. Program objects (even at *INTERPRET) are
not used by IBM Technology for Java.
Consider the special property
This property sets the threshold for the MMI of the JIT. Setting this to a small value will result is
compilation of the classes at startup time and will increase the start up time. In addition, using a very
small value (less than 50) may result in a slower compiled version, since profiling data gathered
during the interpreted phase may not be representative of the actual application characteristics.
Setting this to a high value may result in a somewhat faster startup time and compilation of the
classes will occur once the threshold is reached. However, if the value is set too high then an
increased warm-up time may occur since it will take additional time for the classes to be optimized by
the JIT compiler.
The default value of 2000 is usually OK for most scenarios. This property has no effect when using
IBM Technology for Java.
Package your Java application as a .jar or .zip file.
Packaging multiple classes in one .zip or .jar file should improve class loading time and also code
optimization when using Direct Execution (DE). Within a .zip or .class file, i5/OS Java will attempt
to in-line code from other members of the .zip or .jar file.

Java Language Performance Tips

Due to advances in JIT technology, many common code optimizations which were critical for
performance a few years ago are no longer as necessary in modern JVMs. Even today, these techniques
will not hurt performance. But they may not make a big positive difference either. When making these
types of optimizations, care should be taken to balance the need for performance with other factors such
as code readability and the ease of future maintenance. It is also important to remember that the majority
of the application's CPU time will be spent in a small amount of code. CPU profiling should be used to
identify these "hot spots", and optimizations should be focused on these sections of code.
Various Java code optimizations are well documented. Some of the more common optimizations are
described below:
Minimize object creation
Excessive object creation is a common cause of poor application performance. In addition to the cost
of allocating memory for the new object and invoking its constructor, the new object will use space in
the Java heap, which will result in longer garbage collection cycles. Of course, object creation cannot
be avoided, but it can be minimized in key areas.
The most important areas to look at for reducing object creation is inside loops and other
commonly-executed code paths. Some common causes of object creation include:
String.substring( ) creates a new String object.
The arithmetic methods in java.math.BigDecimal (add, divide, etc) create a new BigDecimal
object.
IBM i 6.1 Performance Capabilities Reference - January/April/October 2008
©
Copyright IBM Corp. 2008
.
os400.jit.mmi.threshold
Chapter 7 - Java Performance
137

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

7xx serversAs/400 risc server

Table of Contents