--- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2020-08-13 04:14:07.011213819 +0000 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2020-08-13 04:14:06.847210674 +0000 @@ -872,7 +872,7 @@ if (result != NULL) { size_t size_in_regions = humongous_obj_size_in_regions(word_size); policy()->old_gen_alloc_tracker()-> - add_allocated_bytes_since_last_gc(size_in_regions * HeapRegion::GrainBytes); + add_allocated_humongous_bytes_since_last_gc(size_in_regions * HeapRegion::GrainBytes); return result; } @@ -892,6 +892,9 @@ assert(succeeded, "only way to get back a non-NULL result"); log_trace(gc, alloc)("%s: Successfully scheduled collection returning " PTR_FORMAT, Thread::current()->name(), p2i(result)); + size_t size_in_regions = humongous_obj_size_in_regions(word_size); + policy()->old_gen_alloc_tracker()-> + record_collection_pause_humongous_allocation(size_in_regions * HeapRegion::GrainBytes); return result; }