Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8215719

G1PeriodicGCSystemLoadThreshold should be a double

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 12
    • hotspot
    • None
    • gc
    • behavioral
    • minimal
    • There is no release that uses G1PeriodicGCSystemLoadThreshold yet, so there can not be a compatibility issue and risk.
    • add/remove/modify command line option

      Summary

      Testing showed that the initial integer type of the G1PeriodicGCSystemLoadThreshold variable is inappropriate for the use case. The value compared against this threshold value is often a fraction of an integer, which can not be expressed with the existing data type.

      Problem

      G1PeriodicGCSystemLoadThreshold is a threshold that is compared to the operating system's load average value.

      The operating system's load average is defined as the length of the system run queue averaged over various periods of time. This average is a positive floating point value.

      The use of G1PeriodicGCSystemLoadThreshold is such that if the garbage collector detects that the current system's load average is below this value, it assumes that the system is idle, and can perform some "idle" actions.

      Currently G1PeriodicGCSystemLoadThreshold is an integer, so the user is not able to specify many interesting threshold values (typically values between 0.0 and 1.0, but may be higher) for this use.

      Solution

      Redefine the type of G1PeriodicGCSystemLoadThreshold as floating point value. This provides the necessary granularity.

      Specification

      The relevant diff from http://cr.openjdk.java.net/~tschatzl/8215548/webrev/src/hotspot/share/gc/g1/g1_globals.hpp.patch:

      --- old/src/hotspot/share/gc/g1/g1_globals.hpp  2018-12-19 15:57:48.905764361 +0100
      +++ new/src/hotspot/share/gc/g1/g1_globals.hpp  2018-12-19 15:57:48.452750266 +0100
      @@ -311,10 +311,11 @@
                 "perform a concurrent GC as periodic GC, otherwise use a STW "    \
                 "Full GC.")                                                       \
                                                                                    \
      -  manageable(uintx, G1PeriodicGCSystemLoadThreshold, 0,                     \
      -          "Maximum recent system wide system load as returned by the 1m "   \
      -          "value of getloadavg() at which G1 triggers a periodic GC. A "    \
      -          "load above this value cancels a given periodic GC. A value of "  \
      -          "zero disables this check.")                                      \
      +  manageable(double, G1PeriodicGCSystemLoadThreshold, 0.0,                  \
      +          "Maximum recent system wide load as returned by the 1m value "    \
      +          "of getloadavg() at which G1 triggers a periodic GC. A load "     \
      +          "above this value cancels a given periodic GC. A value of zero "  \
      +          "disables this check.")                                           \
      +          range(0.0, (double)max_uintx)                                     \

            tschatzl Thomas Schatzl
            tschatzl Thomas Schatzl
            Stefan Johansson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: