8138745: Implement ExitOnOutOfMemory and CrashOnOutOfMemory in HotSpot

Reviewed-by: dholmes, sla
This commit is contained in:
Cheleswer Sahu 2015-12-09 15:31:25 +05:30 committed by Kevin Walls
parent 1feaca45a7
commit ae7369442a
4 changed files with 204 additions and 0 deletions

View file

@ -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);
}
}
}