--- old/src/share/vm/runtime/sweeper.cpp 2014-11-14 16:56:35.607861865 +0300 +++ new/src/share/vm/runtime/sweeper.cpp 2014-11-14 16:56:35.455861868 +0300 @@ -389,7 +389,6 @@ // The last invocation iterates until there are no more nmethods while (!_current.end()) { swept_count++; - handle_safepoint_request(); // Since we will give up the CodeCache_lock, always skip ahead // to the next nmethod. Other blobs can be deleted by other // threads but nmethods are only reclaimed by the sweeper. @@ -402,6 +401,7 @@ freed_memory += process_nmethod(nm); } _seen++; + handle_safepoint_request(); } } @@ -512,6 +512,7 @@ } int NMethodSweeper::process_nmethod(nmethod* nm) { + assert(nm != NULL, "sanity"); assert(!CodeCache_lock->owned_by_self(), "just checking"); int freed_memory = 0;