5 Performance Degradation

The JRockit JVM is designed to provide stable performance throughout an application run in large server environments. Occasionally, you might notice a degradation in performance after the application runs for a while.

This chapter provides information to help you identify and address performance degradation problems. It contains the following topics:

5.1 Tune for Performance

When system performance begins to deteriorate, the problem is often with tuning. Incorrectly tuned compaction might, for example, cause the performance to degrade over time because the fragmentation of the heap increases until the garbage collector must perform a full compaction to avoid throwing an out-of-memory error.

Before engaging in time-consuming troubleshooting and mitigation tasks, try tuning the JRockit JVM for stable performance as described in the Oracle JRockit Performance Tuning Guide.

5.2 Troubleshoot Optimization Problems

Poor performance might be caused by optimization problems,. Such problems usually occur after the program has been running well for a while, and result in symptoms such as the following:

  • The JVM crashes (for more information, see Chapter 6, "Crashing JVM").

  • NullPointerExceptions are thrown from unexpected points in the program.

  • A method returns wrong results.

Before reporting such problems, try running the JVM after disabling optimization (by using the -XnoOpt option).

If the performance improves after you disable optimization, you can assume that the performance degradation was caused by optimization problems. Follow the procedures for isolating and excluding the miscompiled methods as described in Section 6.5.1.3, "Exclude the Problem Method from the Optimization Process".

5.3 Troubleshoot Memory Leak Problems

A memory leak in Java causes the application to run slower over time, because the garbage collector must work harder to free memory. After a while, the JVM throws an out-of-memory error. Note that applications with a small memory leak can sometimes run for days until an out-of-memory error occurs.

To look for initial signs of a memory leak, you can take a Flight Recorder recording and check the heap usage after each old collection. A continuously rising memory usage could indicate a memory leak. For information about creating and interpreting a Flight Recorder recording, see the Oracle JRockit Flight Recorder Run Time Guide.

You can diagnose memory leaks by using the Memory Leak Detector, which helps you pinpoint the class that causes the memory leak. For information about using the Memory Leak Detector, see the Oracle JRockit Mission Control Online Help.

5.4 Contact Oracle Support

If the solutions provided in this section do not help you solve the performance degradation problem, contact Oracle Support, as described in Chapter 9, "Contacting Oracle for Support."