JDK-8319881 : G1: Investigate thread starvation during G1CollectedHeap::attempt_allocation_slow.
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 22
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-11-10
  • Updated: 2023-11-13
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
Relates :  
Description
Threads may be starved of memory in G1CollectedHeap::attempt_allocation_slow while stalled either on the Heap_lock or by a GCPause. 

1. Thread A tries to allocate memory as normal, and tries to start a GC or stalls on the Heap_lock before attempt_allocation_locked; Another thread initiates a GC pause.
2. The GC executes and frees some memory
3. Thread A does not get any of that memory, but other threads also waiting for memory.
4. Thread A goes back to 1.

Investigate how to reduces the occurrence of such starvation. One solution is to pending satisfy allocations during GC.  Additionally, we can satisfy multiple allocations when attempt_allocation_locked allocates out of a new region.