8213898: CDS dumping of springboot asserts in G1ArchiveAllocator::alloc_new_region

HeapRegionManager::find_highest_free needs to check if the region obtained from the HeapRegionManager::_regions is available.

Reviewed-by: tschatzl, sjohanss
This commit is contained in:
Jiangli Zhou 2018-11-16 13:23:50 -05:00
parent 1804d6ce65
commit 14b7467279

View file

@ -321,7 +321,7 @@ uint HeapRegionManager::find_highest_free(bool* expanded) {
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;