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

Shenandoah: region free capacity unit mismatch

XMLWordPrintable

    • gc
    • b07
    • generic
    • generic

        In the code path of mutator allocation, looks like we assume that ShenandoahAllocRequest::size/min_size and region free capacity have same unit, which is apparently not right, unit used in ShenandoahAllocRequest is word but region free capacity is in bytes.

        It should be just one line change here:
        https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp#L883

        Correct code should be like:
        ```
        if (alloc_capacity(r) >= min_size * HeapWordSize) {
           ...
        }
        ```

        In theory, the bug should cause less efficient code in memory allocation, even cause more waste in the worse case.

              xpeng Xiaolong Peng
              xpeng Xiaolong Peng
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: