--- old/src/hotspot/share/gc/g1/g1CollectionSet.cpp 2019-11-25 14:31:31.176545873 +0100 +++ new/src/hotspot/share/gc/g1/g1CollectionSet.cpp 2019-11-25 14:31:30.790533706 +0100 @@ -147,6 +147,11 @@ void G1CollectionSet::start_incremental_building() { assert(_collection_set_cur_length == 0, "Collection set must be empty before starting a new collection set."); assert(_inc_build_state == Inactive, "Precondition"); +#ifdef ASSERT + for (size_t i = 0; i < _collection_set_max_length; i++) { + _inc_collection_set_stats[i].reset(); + } +#endif _inc_bytes_used_before = 0; @@ -251,6 +256,7 @@ _inc_recorded_rs_length_diff += rs_length_diff; double old_non_copy_time = stat->_non_copy_time_ms; + assert(old_non_copy_time >= 0.0, "Non copy time for region %u not initialized yet, is %.3f", hr->hrm_index(), old_non_copy_time); double new_non_copy_time = predict_region_non_copy_time_ms(hr); double non_copy_time_ms_diff = new_non_copy_time - old_non_copy_time;