--- old/src/share/vm/gc/g1/g1CollectedHeap.cpp 2017-06-27 14:19:04.616538344 -0700 +++ new/src/share/vm/gc/g1/g1CollectedHeap.cpp 2017-06-27 14:19:04.484538810 -0700 @@ -76,6 +76,7 @@ #include "oops/oop.inline.hpp" #include "prims/resolvedMethodTable.hpp" #include "runtime/atomic.hpp" +#include "runtime/heapMonitoring.hpp" #include "runtime/init.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/vmThread.hpp" @@ -4307,6 +4308,13 @@ g1_policy()->phase_times()->record_ref_proc_time(ref_proc_time * 1000.0); } +void G1CollectedHeap::process_heap_monitoring() { + log_develop_trace(gc, ref)("HeapSampling [other] : heap monitoring processing"); + G1STWIsAliveClosure is_alive(this); + G1KeepAliveClosure keep_alive(this); + HeapMonitoring::weak_oops_do(&is_alive, &keep_alive); +} + 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 @@ -4525,6 +4533,7 @@ } else { ref_processor_stw()->verify_no_references_recorded(); process_weak_jni_handles(); + process_heap_monitoring(); } if (G1StringDedup::is_enabled()) {