Generational Concurrent GC policy | Subpool GC policy
Tune the Generational Concurrent GC policy
Overview
The goal when tuning the Generational Concurrent policy is to...
- Create a tenure space large enough to hold all persistent application objects.
- Prevent a compaction from occurring in the tenure space
To tune...
- Determine a rough estimate of the size of the persistent object store (tenure space). Typically, for WebSphere applications, this will be a few hundred megabytes.
- Make the tenure space size large enough so that a collection never occurs, or occurs very infrequently.
- Tune the nursery space size by balancing throughput against pause times.
Determine tenure space size
To determine the tenure space, execute a load test of the application under normal load using...
- verbosegc
- Optimal Thruput GC policy (the default policy)
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
Runtime option User Guide description -Xmn<value> Set the initial and maximum size of the new (nursery) heap to the specified value. Equivalent to setting both -Xmns and -Xmnx.
If we set either -Xmns or -Xmnx, you cannot set -Xmn. If we 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> Set 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 we try to use it with -Xmn. If the scavenger is disabled, this option is ignored.
-Xmnx<value> Set 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 we try to use it with -Xmn. If the scavenger is disabled, this option is ignored.
-Xmo<value> Set the initial and maximum size of the old (tenured) heap to the specified value. Equivalent to setting both -Xmos and -Xmox. If we set either -Xmos or -Xmox, you cannot set -Xmo. If we 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> Set 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 we try to use it with -Xmo. -Xmox<value> Set 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 we try to use it with -Xmo.
-Xmr<value> Set 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> Set the remembered maximum size setting