src/share/vm/compiler/compileBroker.cpp

Print this page
rev 4523 : 8012547: Code cache flushing can get stuck reclaming of memory
Summary: Keep sweeping regardless of if we are flushing
Reviewed-by: kvn, twisti

@@ -1227,11 +1227,11 @@
       }
     }
     if (method->is_not_compilable(comp_level)) return NULL;
 
     if (UseCodeCacheFlushing) {
-      nmethod* saved = CodeCache::find_and_remove_saved_code(method());
+      nmethod* saved = CodeCache::reanimate_saved_code(method());
       if (saved != NULL) {
         method->set_code(method, saved);
         return saved;
       }
     }

@@ -1286,13 +1286,13 @@
   // a lock the compiling thread can not acquire. Prefetch it here.
   if (JvmtiExport::should_post_compiled_method_load()) {
     method->jmethod_id();
   }
 
-  // If the compiler is shut off due to code cache flushing or otherwise,
+  // If the compiler is shut off due to code cache getting full
   // fail out now so blocking compiles dont hang the java thread
-  if (!should_compile_new_jobs() || (UseCodeCacheFlushing && CodeCache::needs_flushing())) {
+  if (!should_compile_new_jobs()) {
     CompilationPolicy::policy()->delay_compilation(method());
     return NULL;
   }
 
   // do the compilation