Sun Microsystems Logo
First Previous Next Last Overview
 

LAB-1205: Java Application Performance Analysis

Exercise 11: Use AggressiveHeap (w/parallel collector for server applications)

Learning goals of this exercise

In this exercise you will learn:

Background for this exercise

Please see Exercise 1 for an overview of running the javaperf GUI launcher.

If the -server option is better for server oriented workloads, are there any other server oriented options?  The answer to this is yes:
the option is -XX:+AggresiveHeap.  This option is described in the Java 1.4.2 whitepaper and in the Tuning Guide for 1.4.2.
The idea of this option is that, in conjunction with -server, users have a simple way of telling the JVM that the application is a server workload.

Steps to follow

  1. For this exercise we use only these two options: -server -XX:+AggresiveHeap
    compiler=-server
    heap=-XX:+AggressiveHeap
    gc=
    other=

  2. Click [Start]. You will see the Java 2D Demo application start....  Immediately click on the "Transforms" tab. Then click into the "Shear" area so it fills the entire window.

  3. Notice how the memory areas were sized.   Note the performance of the Shear window.  Notice that you DON'T have the survivor spaces histogram pane (that feature is not supported for the parallel garbage collector).

  4. When you see that the application runtime goes just over one minute click [Stop]

  5. The eden was so big we never even had a minor GC!  And, we can guess that the 3 full GC's we had were a result of explicit system.gc() calls (based on our experience in Exercise 9).

Summary

When should you use -server -XX:+AggresiveHeap?  Whenever you have a server oriented workload it is a good idea to test these options.  Even though these options are often used together they can be used completely independently.

But the heap sizes are wildly oversized?  But perhaps I don't want the parallel collector?  You can still get some of the benefits of AggressiveHeap by selectively overriding the things you do and don't want... In fact, that is the subject of Exercise 12.

Next Steps