-
Enhancement
-
Resolution: Unresolved
-
P4
-
22
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.
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.
- relates to
-
JDK-8192647 GClocker induced GCs can starve threads requiring memory leading to OOME
- Open