JDK-8361934 : G1: try_collect_concurrently has incorrect comment about WhiteBox control stall
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 15
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-07-10
  • Updated: 2025-07-14
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.
Other
tbdUnresolved
Related Reports
Causes :  
Description
In G1CollectedHeap::try_collect_concurrently, in the part handling user-requested collections, there is a place where we need to deal with WhiteBox wanting/having control. The code waits until WhiteBox has relinquished control. But the comment explicitly says not to do that.

A (unpublished) draft of JDK-8240239 (which introduced this code and comment) had that same comment but different code. So the code was changed during the draft phase of that change, but the comment wasn't updated accordingly.

The rationale for the comment is that waiting until control is relinquished may result in waiting through multiple (controlled) concurrent collections, in addition to waiting through STW full collections. There may have been some problem with the earlier (unpublished) code. It was decided that just blocking here until control is released is okay. After all, a retry would just once again be blocked by WhiteBox being in control.