HOWTO: Using Pauseless Garbage Collection

The question how to verify that the pauseless garbage collection feature as introduced with IBM z14 is in place and being used comes up on a regular basis.
Therefore, here are instructions on how to do just that.
  • Verify that the hardware support is in place:
    Pauseless garbage collection is available with IBM z14 or later. In Linux, run the following command to verify that the hardware support is available:
       $ cat /proc/cpuinfo | grep -e "^features"
       features        : esan3 zarch stfle msa [...] vx vxd vxe gs sie

    Make sure that gs is listed, indicating the hardware support.
    In case gs is not listed:
    1. If Linux runs under a hypervisor (z/VM or KVM), verify that the hypervisor supports pauseless garbage collection.
    2. Verify that the Linux distribution you are running supports pauseless garbage collection, too.
  • Download and install IBM Java 8 SR5 or later. You can get it here. Alternatively, any other Java version will do, too, as long as it is based on OpenJ9.
  • Run the following command:
       $ java -Xgc:concurrentScavenge -verbose:gc -version 2>&1 | \
                 grep -i concurrentScavenger
       <attribute name="concurrentScavenger" value="enabled, with H/W assistance" />

    Note that both, enablement of concurrentScavenger as well as H/W assistance must be listed to take full advantage of the feature. If hardware assistance is not available, you might take a performance hit.
You are all set now! To make use of pauseless garbage collection, simply add the option  -Xgc:concurrentScavenge on the Java command line.

No comments:

Post a Comment

Popular Posts