Tuning the Generational Concurrent GC policy
The goal when tuning the Generational Concurrent policy is to create a tenure space large enough to hold all persistent application objects, while also trying to prevent a compaction from occurring in the tenure space. The Generational Concurrent GC policy is tuned by finding the appropriate nursery and tenure heap spaces for the running application. Running with the defaults, the IBM JVM will dynamically size the nursery and tenured spaces, but this may not give the most optimal performance.
To tune the Generation Concurrent GC policy, follow these steps:
1. Determine a rough estimate of the size of the persistent object store.
2. Make the tenure space size large enough so that a collection never occurs, or occurs very infrequently.
3. Tune the nursery space size by balancing throughput against pause times.
Execute test run under normal load
Using available performance and load test applications, such as Rational Performance Tester, schedule a test run of the application under normal load on a production-like environment. For information about how to use Rational Performance Tester including an example of a performance run, see 10.5.3, IBM Rational Performance Tester.
Determine tenure space size
Because the tenured space is where long-term objects are held, it follows that the space should be large enough to hold all persistent application objects. Typically, for WebSphere applications, this will be a few hundred megabytes. To determine the tenure space, execute a load test of the application using verbosegc and Optimal Thruput GC policy (the default policy).
For an explanation about how to enable verbosegc and interpret the output, refer to 6.4.1, Analyzing verbose output. Investigate the verbosegc output to determine the size of the persistent object store within the heap.
Size the tenure space
Now execute test runs of the application with the Generational Concurrent policy (instead of the default policy) using the tenure space determined from the previous procedure. Analyze the verbosegc output to determine how frequently the tenured space is collected. The goal is to never have a collection in the tenured space.
Size the nursery space
The next step is to determine the size of the nursery. In general, a larger nursery is better for application throughput and a smaller nursery will have lower pause times. Start by setting the nursery size to be relatively large. Execute test runs under normal load while measuring response times and throughput. Increase the nursery size if better throughput is desired, or decrease the nursery size if lower pause times are desired.
Generational Concurrent runtime options
Table 6-1 lists the runtime options that you use to tune the Generation Concurrent GC policy.
Table 6-1
Runtime option User Guide description -Xmn<value> Sets the initial and maximum size of the new (nursery) heap to the specified value. Equivalent to setting both -Xmns and -Xmnx. If you set either -Xmns or -Xmnx, you cannot set -Xmn. If you attempt to set -Xmn with either -Xmns or -Xmnx, the VM will not start, returning an error. By default, -Xmn is selected internally according to your system's capability. You can use the -verbose:sizes option to find out the values that the VM is currently using. If the scavenger is disabled, this option is ignored. -Xmns<value> Sets the initial size of the new (nursery) heap to the specified value. By default, this option is selected internally according to your system's capability. This option will return an error if you try to use it with -Xmn. If the scavenger is disabled, this option is ignored. -Xmnx<value> Sets the maximum size of the new (nursery) heap to the specified value. By default, this option is selected internally according to your system's capability. This option will return an error if you try to use it with -Xmn. If the scavenger is disabled, this option is ignored. -Xmo<value> Sets the initial and maximum size of the old (tenured) heap to the specified value. Equivalent to setting both -Xmos and -Xmox. If you set either -Xmos or -Xmox, you cannot set -Xmo. If you attempt to set -Xmo with either -Xmos or -Xmox, the VM will not start, returning an error. By default, -Xmo is selected internally according to your system's capability. You can use the -verbose:sizes option to find out the values that the VM is currently using. -Xmos<value> Sets the initial size of the old (tenure) heap to the specified value. By default, this option is selected internally according to your system's capability. This option will return an error if you try to use it with -Xmo. -Xmox<value> Sets the maximum size of the old (tenure) heap to the specified value. By default, this option is selected internally according to your system's capability. This option will return an error if you try to use it with -Xmo. -Xmr<value> Sets the size of the Garbage Collection "remembered set". This is a list of objects in the old (tenured) heap that have references to objects in the new (nursery) heap. By default, this option is set to 16 kilobytes. -Xmrx<value> Sets the remembered maximum size setting Generational concurrent runtime options