Tuning the JRockit JVM
When you install BEA JRockit JVM, it includes a host of default start-up options that ensure a satisfactory out-of-the-box experience; however, sometimes, these options might not provide your application with the optimal performance. Therefore, BEA JRockit JVM comes with numerous alternative options and algorithms to suit different applications. This section describes some of these options and some basic tuning techniques you can use at startup. You find information on the following subjects:
Before you start BEA JRockit JVM, you need to determine these two factors:
Once you've answered these questions, use the information provided below to tune BEA JRockit JVM to achieve those goals.
Generally, you want to set the maximum heap size as high as possible, but not so high that it causes page faults for the application or for some other application on the same computer. Heap sizing is accomplished by using the -Xms
(minimum heap size) and -Xmx
(maximum heap size) options. For details on these options and guidelines for sizing the heap, please refer to Setting the Heap Size.
As mentioned above, you need to consider how you want JRockit to perform: for the highest possible responsiveness or the highest possible performance? This section describes how to tune for either type of performance.
If you want the highest responsiveness from your application and guarantee minimal pause times, do the following:
-Xgcprio
) and set a pause time (-Xgcprio:pausetime
). When you use the option -Xgcprio:pausetime
, you can also set a target time for the pauses (-Xpausetarget
). That way JRockit tries to adapt the pause times to the length that you specify. If you do not set the option to a specific time, the default value is used (500ms). This is an example of how you can set the pause target:
-Xgc:gencon
). -Xms
) and maximum (-Xmx
) heap sizes, as described in Setting the Heap Size. If you're using a fixed, generational concurrent garbage collector, a larger heap reduces the frequency of garbage collection. This will prevent longer pauses.-Xns
). If the application is creating a lot of temporary objects, you should use a large nursery, to reduce old collection frequency. Larger nurseries usually result in slightly longer pauses, so, while you should try to make the nursery as large as possible, don't make it so large that pause times become unacceptable. If you want the highest possible performance BEA JRockit can provide, you will want to optimize for application thoughput. Set these tuning options at startup:
-Xgcprio:throughput
)-Xgc:parallel
) garbage collector. The parallel garbage collector doesn't use a nursery, so you don't need to set -Xns
.-Xms
) and maximum (-Xmx
) heap sizes that your system can tolerate, as described in Set the Heap Size (not valid for the parallel garbage collector).The JRockit Runtime Analyzer (JRA) is a great way to look at the performance of JRockit. The JRA records what happens in your system in runtime and then saves the findings in a file that can be analyzed through a separate JRA tool. The recording contains information about, for example, memory usage, Java heap content, and hot methods. For information on how to use the JRA, see: