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

VM_G1CollectForAllocation should always check for upgrade to full

XMLWordPrintable

    • gc
    • b08

      In VM_G1CollectForAllocation::doit, if the non-full collection succeeds it either (re)tries the allocation or it checks whether an upgrade to full is needed.

      The possible reasons for upgrading to full include a policy call to force_upgrade_to_full. That can be true for a G1HeterogeneousHeapPolicy when there are borrowed regions. The point here is to prevent returning from the VMOp with a heap size that is greater than MaxHeapSize, instead forcing a full collection.

      But there's no obvious reason why that situation can't also arise when an allocation was requested. In which case the check for upgrade to full should always be done (with associated full collection if needed), and only after that should the conditional allocation be attempted.

            kbarrett Kim Barrett
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: