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

G1 wrongly counts PLABs not allocated in the originally intended allocation "generation"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc

      Description

      When memory is tight during PLAB allocation, G1 attempts to allocate survivor and old gen PLABs in the other memory area (i.e. survivor PLAB in old gen).

      However the caller of the method that handles this (G1CollectedHeap::par_allocate_during_gc()) does not take into account that the returned PLAB buffer might be in the wrong memory area.
      Regardless of the memory area, PLAB statistics are accounted for the requested memory area only.

      E.g. GC tries to allocate a PLAB from survivor, but gets one from old gen regions. Still the allocation statistics are accounted as if that PLAB were from survivor region.

      This results in bad statistics like the gc thinking that it allocated more memory into survivor than the survivor is large.

      Also, we may consider removing the ability to allocate old gen PLAB in survivor: there is not much to gain here since G1 assigns regions lazily, so at most the memory of a single region may be left unused before the inevitable full gc. This is different in the other generational collectors where the allocation is much more strict.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              tschatzl Thomas Schatzl
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: