OpenJDK / jdk / jdk
changeset 56341:bc696d87d032
8231249: Shenandoah: GC retries are too aggressive for tests that expect OOME
Reviewed-by: rkennke
author | shade |
---|---|
date | Mon, 23 Sep 2019 16:24:32 +0200 |
parents | acc7ea6bf0b4 |
children | 7a8de392f9e1 |
files | src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp |
diffstat | 1 files changed, 6 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp Mon Sep 23 14:30:31 2019 +0200 +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp Mon Sep 23 16:24:32 2019 +0200 @@ -809,22 +809,12 @@ // way later after GC happened, only to fail the second allocation, because // other threads have already depleted the free storage. In this case, a better // strategy is to try again, as long as GC makes progress. - // - // Then, we need to make sure the allocation was retried after at least one - // Full GC, which means we want to try more than ShenandoahFullGCThreshold times. - - size_t tries = 0; - - while (result == NULL && _progress_last_gc.is_set()) { - tries++; - control_thread()->handle_alloc_failure(req.size()); - result = allocate_memory_under_lock(req, in_new_region); - } - - while (result == NULL && tries <= ShenandoahFullGCThreshold) { - tries++; - control_thread()->handle_alloc_failure(req.size()); - result = allocate_memory_under_lock(req, in_new_region); + + if (result == NULL) { + do { + control_thread()->handle_alloc_failure(req.size()); + result = allocate_memory_under_lock(req, in_new_region); + } while (result == NULL && _progress_last_gc.is_set()); } } else {