--- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2017-10-16 15:55:14.376967934 +0200 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2017-10-16 15:55:14.104958780 +0200 @@ -70,6 +70,7 @@ #include "gc/shared/preservedMarks.inline.hpp" #include "gc/shared/referenceProcessor.inline.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "gc/shared/weakProcessor.hpp" #include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/iterator.hpp" @@ -4368,14 +4369,23 @@ process_discovered_references(per_thread_states); } else { ref_processor_stw()->verify_no_references_recorded(); - process_weak_jni_handles(); + } + + G1STWIsAliveClosure is_alive(this); + G1KeepAliveClosure keep_alive(this); + + { + double start = os::elapsedTime(); + + WeakProcessor::unlink_or_oops_do(&is_alive, &keep_alive); + + double time_ms = (os::elapsedTime() - start) * 1000.0; + g1_policy()->phase_times()->record_ref_proc_time(time_ms); } if (G1StringDedup::is_enabled()) { double fixup_start = os::elapsedTime(); - G1STWIsAliveClosure is_alive(this); - G1KeepAliveClosure keep_alive(this); G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive, true, g1_policy()->phase_times()); double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;