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

Shenandoah: compact heuristics has incorrect trigger "Free is lower than allocated recently"

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8-shenandoah, 11-shenandoah, 14
    • Fix Version/s: 14
    • Component/s: hotspot
    • Subcomponent:
      gc
    • Resolved In Build:
      b21

      Description

      Current "compact" heuristics has this trigger:

        if (available < threshold_bytes_allocated) {
          log_info(gc)("Trigger: Free (" SIZE_FORMAT "%s) is lower than allocated recently (" SIZE_FORMAT "%s)",

      First of all, it lies about the value it checks: it says "allocated recently", but actually checks the threshold. Second, this is excessive, given the prior check for "available < min_free_threshold", that is supposed to start the GC anyway with any large allocation threshold. Exploring the source code history, it seems the check was always there to trigger the GC the similar way "available < min_free_threshold" does it. "available < min_free_threshold" was added later, making this check completely redundant. It is even more redundant, as default setting of "min_free_threshold" is 10, making it exactly the same check.

      This bug makes cycles more frequent with *larger* -XX:ShenandoahAllocationThreshold on busy heaps. At the extreme, setting -XX:SAT=100 devolves to back-to-back cycles, because available space is always less than entire heap.

        Attachments

          Activity

            People

            • Assignee:
              shade Aleksey Shipilev
              Reporter:
              shade Aleksey Shipilev
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: