--- old/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp 2018-04-03 16:36:53.512246425 +0200 +++ new/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp 2018-04-03 16:36:53.256238627 +0200 @@ -1025,9 +1025,6 @@ void distribute_marked_bytes(HeapRegion* hr, size_t marked_words) { uint const region_idx = hr->hrm_index(); - assert(hr->is_starts_humongous(), - "Should not have marked bytes " SIZE_FORMAT " in non-starts humongous region %u (%s)", - marked_words, region_idx, hr->get_type_str()); uint num_regions_in_humongous = (uint)G1CollectedHeap::humongous_obj_size_in_regions(marked_words); for (uint i = region_idx; i < (region_idx + num_regions_in_humongous); i++) { @@ -1035,6 +1032,8 @@ size_t const words_to_add = MIN2(HeapRegion::GrainWords, marked_words); assert(words_to_add > 0, "Out of space to distribute before end of humongous object in region %u (starts %u)", i, region_idx); + log_trace(gc, marking)("Adding " SIZE_FORMAT " words to humongous region %u (%s)", + words_to_add, i, r->get_type_str()); r->add_to_marked_bytes(words_to_add * HeapWordSize); marked_words -= words_to_add; } @@ -1050,15 +1049,12 @@ // region. We need to distribute this value across the entire set of regions a // humongous object spans. if (hr->is_humongous()) { + assert(hr->is_starts_humongous() || marked_words == 0, + "Should not have marked words " SIZE_FORMAT " in non-starts humongous region %u (%s)", + marked_words, region_idx, hr->get_type_str()); + if (marked_words > 0) { - log_trace(gc, marking)("Adding " SIZE_FORMAT " words to humongous start region %u (%s), word size %d (%f)", - marked_words, region_idx, hr->get_type_str(), - oop(hr->bottom())->size(), (double)oop(hr->bottom())->size() / HeapRegion::GrainWords); distribute_marked_bytes(hr, marked_words); - } else { - assert(marked_words == 0, - "Asked to add " SIZE_FORMAT " words to add to continues humongous region %u (%s)", - marked_words, region_idx, hr->get_type_str()); } } else { log_trace(gc, marking)("Adding " SIZE_FORMAT " words to region %u (%s)", marked_words, region_idx, hr->get_type_str());