8213898: CDS dumping of springboot asserts in G1ArchiveAllocator::alloc_new_region
Summary: HeapRegionManager::find_highest_free needs to check if the region obtained from the HeapRegionManager::_regions is available.
Reviewed-by: tschatzl, sjohanss
--- a/src/hotspot/share/gc/g1/heapRegionManager.cpp Fri Nov 16 09:49:05 2018 -0800
+++ b/src/hotspot/share/gc/g1/heapRegionManager.cpp Fri Nov 16 13:23:50 2018 -0500
@@ -321,7 +321,7 @@
uint curr = max_length() - 1;
while (true) {
HeapRegion *hr = _regions.get_by_index(curr);
- if (hr == NULL) {
+ if (hr == NULL || !is_available(curr)) {
uint res = expand_at(curr, 1, NULL);
if (res == 1) {
*expanded = true;