Performance Tuning Guide

 Previous Next Contents View as PDF  

Tuning the WebLogic JRockit 7.0 JVM Memory Management System

Have you ever seen strange pauses in your application that you haven't been able to explain? Have you seen one or all CPUs pegged on 100% utilization and all the others on 0% and still very few transactions in your system? If you answered yes to either of these two questions, your application might have been suffering from the effects of a poorly performing garbage collector. Some fairly simple tuning of the memory management system can improve performance dramatically for many applications.

This section includes information on the following subjects:

 


Memory Management Terminology

Before continuing, there are some terms you should understand. You may already be familiar with some of the terms, especially if you have read any other documents about garbage collectors.

 


WebLogic JRockit 7.0 JVM Garbage Collectors

This section describes the four garbage collectors available in WebLogic JRockit 7.0 JVM.

Generational Copying

The first type of WebLogic JRockit 7.0 JVM garbage collector is the generational copying garbage collector (-Xgc:gencopy). It is specifically designed as a lightweight alternative for use on single CPU systems with a small (less then 128 MB) heap. It is suitable for testing applications on your desktop machine; however for a deployment environment another garbage collector would in most cases be more efficient.

Single Spaced Concurrent

The second type of WebLogic JRockit 7.0 JVM garbage collector is the single spaced concurrent garbage collector (-Xgc:singlecon). What is unique about the concurrent garbage collectors is that they remove garbage collection pauses completely. Using these garbage collectors, the heaps can be gigabyte-size and there will be no long pauses. However, keep in mind that concurrent garbage collectors trade memory throughput for reduced pause time. It takes longer between the time the object is referenced the last time and the system detects and reclaims it; in other words it takes longer for the object to die. The natural consequence of this is that you will most likely need a larger heap with a concurrent garbage collector than you need with any other. In addition, if your ordinary Java threads create more garbage than the concurrent garbage collector manages to collect, there will be pauses while the Java threads are waiting for the concurrent garbage collector to complete its cycle.

Generational Concurrent

The third type of WebLogic JRockit 7.0 JVM garbage collector is the generational concurrent garbage collector (-Xgc:gencon). In this garbage collector, objects are allocated in the young generation. When the young generation (called a nursery) is full, WebLogic JRockit 7.0 JVM "stops-the-world" and moves the objects that are still live in the young generation to the old generation. An old collector thread runs in the background all the time; it marks objects in the old space as live and removes the dead objects, returning them to the JVM as free space.

The advantage of the generational concurrent garbage collector compared to the single spaced concurrent garbage collector is that it has a higher memory throughput.

Parallel

The fourth type of WebLogic JRockit JVM garbage collector is the parallel garbage collector (-Xgc:parallel). When the heap is full, all Java threads are stopped and every CPU is used to perform a complete garbage collection of the entire heap. A parallel collector can have longer pause times than concurrent collectors, but it maximizes throughput. Even on single CPU machines, this maximized performance makes parallel the recommended garbage collector, provided that your application can tolerate the longer pause times.

 


Monitoring Garbage Collection

The option -Xgcreport causes WebLogic JRockit 7.0 JVM to print a comprehensive garbage collection report at program completion. The option -Xgcpause causes WebLogic JRockit 7.0 JVM to print a line each time Java threads are stopped for garbage collection. Combining the two is a very good way of examining the memory behavior of your application.

 


More Memory Management Options

The following options allow you to manage your memory more efficiently.

Notes:

The -Xcleartype:local option is available only if the -Xallocationtype is set to local.

On IA64 systems the option alloc is not available.

 


Memory Management System Defaults

This section describes the default values for the WebLogic JRockit 7.0 JVM Memory Management system. To provide the best out-of-the-box performance possible they adapt automatically to the specific platform on which the VM is running.

Heap Size

If the initial heap size (-Xms) is not set the initial heap size will be 75% of the free memory. Generally, the default maximum heap size (-Xmx) is 75% of the physical memory in the machine. However, when running WebLogic JRockit with a small initial heap (that is, less than about 32MB) the default maximum heap size will depend on the initial heap size. The default maximum heap size is -Xms2 (in megabytes), up to 75% of the physical memory; for example, if -Xms is 8MB, the default maximum heap size will be 8MB2, or 64MB; if -Xms is 128MB, the default maximum heap size would be 1282, or 16384MB (16 GB). Be aware that, if the machine has less physical memory than the value of -Xms2, the default maximum heap will be restricted to 75% of the physical memory.

Note: These figures are subject to any platform limitations that determine how much contiguous memory a process can allocate.

Garbage Collector

If the garbage collector (-Xgc) has not been set and the maximum heap size (set by using -Xmx or using the default as described above) is less than 128 MB, the default garbage collector will be the generational copying (gencopy) garbage collector, otherwise the default is the generational concurrent (gencon) garbage collector.

Nursery Size

If the nursery size (-Xns) has not been set the default size depends on the number of CPUs. For the generational copying (gencopy) garbage collector the default nursery size is 320  KB times the number of CPUs and for the generational concurrent (gencon) garbage collector the default nursery size is 10  MB times the number of CPUs.

Thread Stack Size

If the thread stack size (-Xss) has not been set the default value depends on the threading system and the platform you are running on. When using thin threads the minimum thread stack size is 8  kilobytes and the default is 64  kilobytes. When using native threads the minimum thread stack size is 16  kilobytes. For Windows the default thread stack size when using native threads is 64  kilobytes and for Linux it is 128  kilobytes.

Note: If -Xss is set to less than the minimum value, the minimum value will be used automatically.

Allocation Type

If the allocation type (-Xallocationtype) is not set, the default is global for the generational copying (gencopy) garbage collector and local for all others (singlecon, gencon, and parallel).

Clear Type

If the clear type (-Xcleartype) is not set the default is alloc on IA32  systems and gc on IA64  systems.

Note: On IA64  systems the option alloc is not available.

 

Back to Top Previous Next