mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 06:14:49 +02:00
4360113: Evict nmethods when code cache gets full
Speculatively unload the oldest nmethods when code cache gets full. Reviewed-by: never, kvn
This commit is contained in:
parent
9aa675b7e6
commit
a57d68e35b
19 changed files with 452 additions and 76 deletions
|
@ -2146,19 +2146,8 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) {
|
|||
// CodeCache is full, disable compilation
|
||||
// Ought to log this but compile log is only per compile thread
|
||||
// and we're some non descript Java thread.
|
||||
UseInterpreter = true;
|
||||
if (UseCompiler || AlwaysCompileLoopMethods ) {
|
||||
#ifndef PRODUCT
|
||||
warning("CodeCache is full. Compiler has been disabled");
|
||||
if (CompileTheWorld || ExitOnFullCodeCache) {
|
||||
before_exit(JavaThread::current());
|
||||
exit_globals(); // will delete tty
|
||||
vm_direct_exit(CompileTheWorld ? 0 : 1);
|
||||
}
|
||||
#endif
|
||||
UseCompiler = false;
|
||||
AlwaysCompileLoopMethods = false;
|
||||
}
|
||||
MutexUnlocker mu(AdapterHandlerLibrary_lock);
|
||||
CompileBroker::handle_full_code_cache();
|
||||
return NULL; // Out of CodeCache space
|
||||
}
|
||||
entry->relocate(B->instructions_begin());
|
||||
|
@ -2282,19 +2271,8 @@ nmethod *AdapterHandlerLibrary::create_native_wrapper(methodHandle method) {
|
|||
// CodeCache is full, disable compilation
|
||||
// Ought to log this but compile log is only per compile thread
|
||||
// and we're some non descript Java thread.
|
||||
UseInterpreter = true;
|
||||
if (UseCompiler || AlwaysCompileLoopMethods ) {
|
||||
#ifndef PRODUCT
|
||||
warning("CodeCache is full. Compiler has been disabled");
|
||||
if (CompileTheWorld || ExitOnFullCodeCache) {
|
||||
before_exit(JavaThread::current());
|
||||
exit_globals(); // will delete tty
|
||||
vm_direct_exit(CompileTheWorld ? 0 : 1);
|
||||
}
|
||||
#endif
|
||||
UseCompiler = false;
|
||||
AlwaysCompileLoopMethods = false;
|
||||
}
|
||||
MutexUnlocker mu(AdapterHandlerLibrary_lock);
|
||||
CompileBroker::handle_full_code_cache();
|
||||
}
|
||||
return nm;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue