--- old/src/share/vm/gc/g1/g1CollectedHeap.cpp 2017-06-21 11:43:07.243557803 -0700 +++ new/src/share/vm/gc/g1/g1CollectedHeap.cpp 2017-06-21 11:43:07.119558261 -0700 @@ -75,6 +75,7 @@ #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" +#include "runtime/heapMonitoring.hpp" #include "runtime/init.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/vmThread.hpp" @@ -4282,6 +4283,13 @@ g1_policy()->phase_times()->record_ref_proc_time(ref_proc_time * 1000.0); } +void G1CollectedHeap::process_heap_monitoring() { + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [other] : heap monitoring"); + G1STWIsAliveClosure is_alive(this); + G1KeepAliveClosure keep_alive(this); + HeapMonitoring::weak_oops_do(NULL, &is_alive, &keep_alive, NULL); +} + void G1CollectedHeap::preserve_cm_referents(G1ParScanThreadStateSet* per_thread_states) { // Any reference objects, in the collection set, that were 'discovered' // by the CM ref processor should have already been copied (either by @@ -4500,6 +4508,7 @@ } else { ref_processor_stw()->verify_no_references_recorded(); process_weak_jni_handles(); + process_heap_monitoring(); } if (G1StringDedup::is_enabled()) {