--- old/src/hotspot/share/gc/serial/genMarkSweep.cpp 2019-03-11 22:56:21.946696567 +0100 +++ new/src/hotspot/share/gc/serial/genMarkSweep.cpp 2019-03-11 22:56:21.402687747 +0100 @@ -75,10 +75,6 @@ gch->trace_heap_before_gc(_gc_tracer); - // When collecting the permanent generation Method*s may be moving, - // so we either have to flush all bcp data or convert it into bci. - CodeCache::gc_prologue(); - // Increment the invocation count _total_invocations++; @@ -128,7 +124,7 @@ rs->invalidate_or_clear(old_gen); } - CodeCache::gc_epilogue(); + gch->prune_nmethods(); JvmtiExport::gc_epilogue(); // refs processing: clean slate