JDK-8308507 : G1: GClocker induced GCs can starve threads requiring memory leading to OOME
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9,10,11,14,16,17,20,21
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2023-05-22
  • Updated: 2024-01-23
  • Resolved: 2023-12-04
Related Reports
Relates :  
Sub Tasks
JDK-8309349 :  
Description
Threads may be starved from receiving memory by the GClocker. This typically leads to OOME in the affected threads. This works as follows:

1. Thread A tries to allocate memory as normal, and tries to start a GC; the GCLocker is active and so the thread gets stalled waiting for the GC
2. GCLocker induced GC executes and frees some memory
3. Thread A does not get any of that memory, but other threads also waiting for memory.
4. Goto 1 until the gclocker retry count has been reached
Comments
With JDK 22 G1 does not use GCLocker any more so the issue can not occur. There is also still JDK-8192647 for the other collectors, and the problem still applies to JDK 21 for G1, so if necessary a backport for G1 can be made under the umbrella of that one.
04-12-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14077 Date: 2023-05-22 11:44:24 +0000
22-05-2023