--- old/src/hotspot/share/runtime/sweeper.cpp 2017-11-15 21:00:35.000000000 -0800 +++ new/src/hotspot/share/runtime/sweeper.cpp 2017-11-15 21:00:35.000000000 -0800 @@ -699,7 +699,7 @@ void NMethodSweeper::possibly_flush(nmethod* nm) { if (UseCodeCacheFlushing) { - if (!nm->is_locked_by_vm() && !nm->is_native_method()) { + if (!nm->is_locked_by_vm() && !nm->is_native_method() && !nm->is_not_installed()) { bool make_not_entrant = false; // Do not make native methods not-entrant