G1HeapRegionManager::find_contiguous_allow_expand ignores free regions when checking regions available for allocation

XMLWordPrintable

    • gc
    • b22

      The early return in G1HeapRegionManager::find_contiguous_allow_expand that checks whether we have enough regions to satisfy an allocation does not consider free regions:

        // Check if we can actually satisfy the allocation.
        if (num_regions > available()) {
          return G1_NO_HRM_INDEX;
        }
      Therefore, a `expand_and_allocate_humongous` call may fail, even though a subsequent `expand_and_allocate` call succeeds. This can lead to unexpected allocation behavior.

            Assignee:
            Ivan Walulya
            Reporter:
            Ivan Walulya
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: