Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/sharedRuntime.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 | 24128c2ffa87 |
children | 18a389214829 |
comparison
equal
deleted
inserted
replaced
1201:24128c2ffa87 | 1202:5f24d0319e54 |
---|---|
2144 } | 2144 } |
2145 if (B == NULL) { | 2145 if (B == NULL) { |
2146 // CodeCache is full, disable compilation | 2146 // CodeCache is full, disable compilation |
2147 // Ought to log this but compile log is only per compile thread | 2147 // Ought to log this but compile log is only per compile thread |
2148 // and we're some non descript Java thread. | 2148 // and we're some non descript Java thread. |
2149 UseInterpreter = true; | 2149 MutexUnlocker mu(AdapterHandlerLibrary_lock); |
2150 if (UseCompiler || AlwaysCompileLoopMethods ) { | 2150 CompileBroker::handle_full_code_cache(); |
2151 #ifndef PRODUCT | |
2152 warning("CodeCache is full. Compiler has been disabled"); | |
2153 if (CompileTheWorld || ExitOnFullCodeCache) { | |
2154 before_exit(JavaThread::current()); | |
2155 exit_globals(); // will delete tty | |
2156 vm_direct_exit(CompileTheWorld ? 0 : 1); | |
2157 } | |
2158 #endif | |
2159 UseCompiler = false; | |
2160 AlwaysCompileLoopMethods = false; | |
2161 } | |
2162 return NULL; // Out of CodeCache space | 2151 return NULL; // Out of CodeCache space |
2163 } | 2152 } |
2164 entry->relocate(B->instructions_begin()); | 2153 entry->relocate(B->instructions_begin()); |
2165 #ifndef PRODUCT | 2154 #ifndef PRODUCT |
2166 // debugging suppport | 2155 // debugging suppport |
2280 nm->post_compiled_method_load_event(); | 2269 nm->post_compiled_method_load_event(); |
2281 } else { | 2270 } else { |
2282 // CodeCache is full, disable compilation | 2271 // CodeCache is full, disable compilation |
2283 // Ought to log this but compile log is only per compile thread | 2272 // Ought to log this but compile log is only per compile thread |
2284 // and we're some non descript Java thread. | 2273 // and we're some non descript Java thread. |
2285 UseInterpreter = true; | 2274 MutexUnlocker mu(AdapterHandlerLibrary_lock); |
2286 if (UseCompiler || AlwaysCompileLoopMethods ) { | 2275 CompileBroker::handle_full_code_cache(); |
2287 #ifndef PRODUCT | |
2288 warning("CodeCache is full. Compiler has been disabled"); | |
2289 if (CompileTheWorld || ExitOnFullCodeCache) { | |
2290 before_exit(JavaThread::current()); | |
2291 exit_globals(); // will delete tty | |
2292 vm_direct_exit(CompileTheWorld ? 0 : 1); | |
2293 } | |
2294 #endif | |
2295 UseCompiler = false; | |
2296 AlwaysCompileLoopMethods = false; | |
2297 } | |
2298 } | 2276 } |
2299 return nm; | 2277 return nm; |
2300 } | 2278 } |
2301 | 2279 |
2302 #ifdef HAVE_DTRACE_H | 2280 #ifdef HAVE_DTRACE_H |