comparison src/share/vm/ci/ciEnv.cpp @ 1202:5f24d0319e54

4360113: Evict nmethods when code cache gets full Summary: Speculatively unload the oldest nmethods when code cache gets full. Reviewed-by: never, kvn Contributed-by: eric.caspole@amd.com
author kvn
date Fri, 29 Jan 2010 09:27:22 -0800
parents 4ce7240d622c
children 7f8790caccb0
comparison
equal deleted inserted replaced
1201:24128c2ffa87 1202:5f24d0319e54
960 } 960 }
961 961
962 if (nm == NULL) { 962 if (nm == NULL) {
963 // The CodeCache is full. Print out warning and disable compilation. 963 // The CodeCache is full. Print out warning and disable compilation.
964 record_failure("code cache is full"); 964 record_failure("code cache is full");
965 UseInterpreter = true; 965 {
966 if (UseCompiler || AlwaysCompileLoopMethods ) { 966 MutexUnlocker ml(Compile_lock);
967 #ifndef PRODUCT 967 MutexUnlocker locker(MethodCompileQueue_lock);
968 warning("CodeCache is full. Compiler has been disabled"); 968 CompileBroker::handle_full_code_cache();
969 if (CompileTheWorld || ExitOnFullCodeCache) {
970 before_exit(JavaThread::current());
971 exit_globals(); // will delete tty
972 vm_direct_exit(CompileTheWorld ? 0 : 1);
973 }
974 #endif
975 UseCompiler = false;
976 AlwaysCompileLoopMethods = false;
977 } 969 }
978 } else { 970 } else {
979 NOT_PRODUCT(nm->set_has_debug_info(has_debug_info); ) 971 NOT_PRODUCT(nm->set_has_debug_info(has_debug_info); )
980 nm->set_has_unsafe_access(has_unsafe_access); 972 nm->set_has_unsafe_access(has_unsafe_access);
981 973