mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8138745: Implement ExitOnOutOfMemory and CrashOnOutOfMemory in HotSpot
Reviewed-by: dholmes, sla
This commit is contained in:
parent
1feaca45a7
commit
ae7369442a
4 changed files with 204 additions and 0 deletions
|
@ -305,6 +305,16 @@ void report_java_out_of_memory(const char* message) {
|
|||
if (OnOutOfMemoryError && OnOutOfMemoryError[0]) {
|
||||
VMError::report_java_out_of_memory(message);
|
||||
}
|
||||
|
||||
if (CrashOnOutOfMemoryError) {
|
||||
tty->print_cr("Aborting due to java.lang.OutOfMemoryError: %s", message);
|
||||
fatal("OutOfMemory encountered: %s", message);
|
||||
}
|
||||
|
||||
if (ExitOnOutOfMemoryError) {
|
||||
tty->print_cr("Terminating due to java.lang.OutOfMemoryError: %s", message);
|
||||
os::exit(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue