File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed
src/hotspot/share/gc/shenandoah Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -809,22 +809,12 @@ HeapWord* ShenandoahHeap::allocate_memory(ShenandoahAllocRequest& req) {
809
809
// way later after GC happened, only to fail the second allocation, because
810
810
// other threads have already depleted the free storage. In this case, a better
811
811
// strategy is to try again, as long as GC makes progress.
812
- //
813
- // Then, we need to make sure the allocation was retried after at least one
814
- // Full GC, which means we want to try more than ShenandoahFullGCThreshold times.
815
-
816
- size_t tries = 0 ;
817
-
818
- while (result == NULL && _progress_last_gc.is_set ()) {
819
- tries++;
820
- control_thread ()->handle_alloc_failure (req.size ());
821
- result = allocate_memory_under_lock (req, in_new_region);
822
- }
823
812
824
- while (result == NULL && tries <= ShenandoahFullGCThreshold) {
825
- tries++;
826
- control_thread ()->handle_alloc_failure (req.size ());
827
- result = allocate_memory_under_lock (req, in_new_region);
813
+ if (result == NULL ) {
814
+ do {
815
+ control_thread ()->handle_alloc_failure (req.size ());
816
+ result = allocate_memory_under_lock (req, in_new_region);
817
+ } while (result == NULL && _progress_last_gc.is_set ());
828
818
}
829
819
830
820
} else {
You can’t perform that action at this time.
0 commit comments