JDK-8280087 : G1: Handle out-of-mark stack situations during reference processing more gracefully
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 11,17,19
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-01-17
  • Updated: 2025-08-22
  • Resolved: 2023-12-18
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 23
23 b03Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8336909 :  
Description
Currently, after JDK-8202049, G1 just bails out if there is not enough mark stack during reference processing in the Remark pause.

A comment in the CR also states that:

"We decided that we will change the marking to simply expand the global mark stack when it goes out of memory, until MarkStackSizeMax. We will exit the VM if that is not enough global mark stack memory available for processing. We will remove the re-scan of the region as it is already complicated enough and adding the condition that we rescan only outside of weak reference processing makes it even worse. "

This has not implemented until now as JDK-8280029 indicates, so implement global mark stack resizing (until MarkStackSizeMax) in this case *without* rescanning the heap (which would cause errors in reference processing).
Comments
Changeset: f696796e Author: Ivan Walulya <iwalulya@openjdk.org> Date: 2023-12-18 09:43:53 +0000 URL: https://git.openjdk.org/jdk/commit/f696796e888d62535e6c864ce6fdf912eef0c3ed
18-12-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16979 Date: 2023-12-05 17:40:11 +0000
05-12-2023

Issue JDK-8313582 problem-listed a few tests, please un-problemlist when fixed.
01-09-2023

Changed to enhancement as this is new functionality.
29-03-2022