JDK-8233822 : VM_G1CollectForAllocation should always check for upgrade to full
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 14
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-11-07
  • Updated: 2020-02-04
  • Resolved: 2020-01-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15 b08Fixed
Related Reports
Relates :  
Description
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.

Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/c7d4f2849dbf User: kbarrett Date: 2020-01-29 21:22:48 +0000
29-01-2020