Tuning the Sun JVM

The JVM offers several tuning parameters affecting the performance of WASs and application performance.

 

Sun JDK 1.3 HotSpot -server warm-up

The HotSpot JVM introduces adaptive JVM technology containing algorithms for optimizing byte code execution over time. The JVM runs in two modes, -server and -client. Performance can be significantly enhanced if running in -server mode and a sufficient amount of time is allowed for a HotSpot JVM to warm up by performing continuous execution of byte code.

In most cases, -server mode should be run. This produces more efficient runtime execution over extended periods. The -client option can be used if a faster startup time and smaller memory footprint are preferred, at the cost of lower extended performance.

The -server option is enabled by default and is the recommended value. Follow these steps to change the -client or -server mode: Select Servers -> Application Servers. Select the appserver you want to tune. Select the link Process Definition under Additional Properties. Select Java Virtual Machine under Additional Properties. Select Custom Properties under Additional Properties. Click New and enter HotSpotOption in the Name field. Enter -client or -server in the Value field. Restart the appserver.

 

Sun JDK 1.3 HotSpot new generation pool size

Most garbage collection algorithms iterate every object in the heap to determine which objects to free. The HotSpot JVM introduces generation garbage collection, which makes use of separate memory pools to contain objects of different ages. These pools can be garbage collected independently from one another. The sizes of these memory pools can be adjusted. Extra work can be avoided by sizing the memory pools so that short-lived objects will never live through more than one garbage collection cycle.

If garbage collection has become a bottleneck, try customizing the generation pool settings. The default values are NewSize=2m, MaxNewSize=32m. Select Servers -> Application Servers. Select the name of the appserver you want to tune. Select the Process Definition link under Additional Properties. Select Java Virtual Machine under Additional Properties. Enter the following values in the Generic JVM Arguments field:

-XX:NewSize (lower bound)

-XX:MaxNewSize (upper bound) Apply and save your changes, then restart the appserver.

It is recommended that you set the new generation pool size between 25 to 50% of the total heap size.

 

Miscellaneous JVM settings

Following are several generic JVM setting recommendations that apply to most or all existing JVMs.

 

Just In Time (JIT) compiler

The Just In Time (JIT) compiler can significantly affect performance. If you disable the JIT compiler, throughput decreases noticeably. Therefore, for performance reasons, keep JIT enabled.

To determine the setting of this parameter: Select Servers -> Application Servers. Select the appserver you want to tune. Select the link Process Definition under Additional Properties. Select Java Virtual Machine under Additional Properties. Check the setting of the Disable JIT check box. If changes are made, save them and restart the appserver.

 

Heap size settings

These parameters can set the maximum and initial heap sizes for the JVM.

In general, increasing the size of the Java heap improves throughput until the heap no longer resides in physical memory. After the heap begins swapping to disk, Java performance drastically suffers. Therefore, the maximum heap size needs to be low enough to contain the heap within physical memory.

The physical memory usage must be shared between the JVM and other applications running on the system, such as the database. For assurance, use a smaller heap, for example 64 MB, on machines with less memory.

Try a maximum heap of 128 MB on a smaller machine, that is, less than 1 GB of physical memory. Use 256 MB for systems with 2 GB memory, and 512 MB for larger systems. The starting point depends on the application.

If performance runs are being conducted and highly repeatable results are needed, set the initial and maximum sizes to the same value. This setting eliminates any heap growth during the run. For production systems where the working set size of the Java applications is not well understood, an initial setting of one-fourth the maximum setting is a good starting value. The JVM will then try to adapt the size of the heap to the working set of the Java application. Select Servers -> Application Servers. Select the appserver you want to tune. Select Process Definition under Additional Properties. Select Java Virtual Machine under Additional Properties. In the General Properties configuration, enter values for Initial Heap Size and Maximum Heap Size fields. Apply and save your changes, then restart the appserver.

 

Class garbage collection

Disabling class garbage collection enables more class reuse, which, in some cases, has resulted in small performance improvements.

In most cases, run with class garbage collection turned on. This is the default.

To disable class garbage collection, enter the value -Xnoclassgc in the Generic JVM Arguments field of the appservers' JVM configuration. To do this: Select Servers -> Application Servers. Select the appserver you want to tune. Select the link Process Definition under Additional Properties. Select the link Java Virtual Machine under Additional Properties. Enter the value -Xnoclassgc in the Generic JVM Arguments field. Apply and save your changes. Restart the appserver.

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.