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

ZGC: ZObjectAllocator::used() should take undone allocations into account

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 14
    • Fix Version/s: 14
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      b09

      Description

      In ZObjectAllocator, when we allocate a page we increment _used. However, we might later undo that page allocation, but we then leave _used as is. This results in a sometimes slightly incorrect value being reported by ZCollectedHeap::tlab_used(), which is fed into the TLAB heuristics. This incorrectness is not that big of a deal, but we should still fix this.

      We can't safely decrement _used (because we might be executing on a different CPU now), but we can track the amount of undos we've done, and later subtract that from _used.

        Attachments

          Activity

            People

            Assignee:
            pliden Per Liden
            Reporter:
            pliden Per Liden
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: