--- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2020-06-01 22:21:14.846865086 +0000 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2020-06-01 22:21:14.630860973 +0000 @@ -871,7 +871,8 @@ result = humongous_obj_allocate(word_size); if (result != NULL) { size_t size_in_regions = humongous_obj_size_in_regions(word_size); - policy()->add_bytes_allocated_in_old_since_last_gc(size_in_regions * HeapRegion::GrainBytes); + policy()->old_gen_alloc_tracker()-> + add_allocated_bytes_since_last_gc(size_in_regions * HeapRegion::GrainBytes); return result; } @@ -4085,7 +4086,8 @@ } void G1CollectedHeap::record_obj_copy_mem_stats() { - policy()->add_bytes_allocated_in_old_since_last_gc(_old_evac_stats.allocated() * HeapWordSize); + policy()->old_gen_alloc_tracker()-> + add_allocated_bytes_since_last_gc(_old_evac_stats.allocated() * HeapWordSize); _gc_tracer_stw->report_evacuation_statistics(create_g1_evac_summary(&_survivor_evac_stats), create_g1_evac_summary(&_old_evac_stats)); @@ -4186,7 +4188,7 @@ g1h->alloc_buffer_stats(G1HeapRegionAttr::Old)->add_failure_used_and_waste(_failure_used_words, _failure_waste_words); G1Policy *policy = g1h->policy(); - policy->add_bytes_allocated_in_old_since_last_gc(_bytes_allocated_in_old_since_last_gc); + policy->old_gen_alloc_tracker()->add_allocated_bytes_since_last_gc(_bytes_allocated_in_old_since_last_gc); policy->record_rs_length(_rs_length); policy->cset_regions_freed(); }