Generational Concurrent GC policy | Subpool GC policy


Tune the Generational Concurrent GC policy


Overview

The goal...

To tune...

  1. Derive rough estimate of persistent object store size (tenure space).
  2. Set a 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.


Determine tenure space size

For WAS applications, tenure space size is generally a few hundred MB.

To determine your tenure space requirements, execute a load test of the application under normal load using...

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

Example Description
-Xmn2048M Set initial and maximum size of the nursery heap to 2048 MB

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.

-Xmns1024M Initial size of the nursery heap

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.

-Xmnx2048M Set maximum size of the nursery heap

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.

-Xmo1024M Initial and maximum size of the tenured heap

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.

-Xmos1024M Initial size of the old (tenure) heap
-Xmox1024M Maximum size of the old (tenure) heap.

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.

-Xmr16K Size of the Garbage Collection "remembered set".

These objects in the tenured heap have references to objects in the nursery heap. Default is 16 kilobytes.

-Xmrx1024M Remembered maximum size setting