< prev index next >

src/hotspot/share/gc/g1/g1CollectedHeap.hpp

Print this page
rev 48467 : 8137099: G1 needs to "upgrade" GC within the safepoint if it can't allocate during that safepoint to avoid OoME
Summary: During a minor GC, if memory allocation fails, start a full GC within the same VM operation in the same safepoint. This avoids a race where the GC locker can prevent the full GC from occurring, and a premature OoME.
Reviewed-by:
Contributed-by: thomas.schatzl@oracle.com, axel.siebenborn@sap.com
rev 48469 : imported patch 8137099-sjohanns-messages
rev 48470 : [mq]: 8137099-erikd-review
rev 48471 : [mq]: 8137099-erikd-review2

*** 1061,1072 **** virtual bool is_maximal_no_gc() const { return _hrm.available() == 0; } // Returns whether there are any regions left in the heap for allocation. ! bool no_more_regions_left_for_allocation() const { ! return is_maximal_no_gc() && num_free_regions() == 0; } // The current number of regions in the heap. uint num_regions() const { return _hrm.length(); } --- 1061,1072 ---- virtual bool is_maximal_no_gc() const { return _hrm.available() == 0; } // Returns whether there are any regions left in the heap for allocation. ! bool has_regions_left_for_allocation() const { ! return !is_maximal_no_gc() || num_free_regions() != 0; } // The current number of regions in the heap. uint num_regions() const { return _hrm.length(); }
< prev index next >