1 /* |
1 /* |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
300 |
300 |
301 if (OnOutOfMemoryError && OnOutOfMemoryError[0]) { |
301 if (OnOutOfMemoryError && OnOutOfMemoryError[0]) { |
302 VMError err(message); |
302 VMError err(message); |
303 err.report_java_out_of_memory(); |
303 err.report_java_out_of_memory(); |
304 } |
304 } |
|
305 |
|
306 if (CrashOnOutOfMemoryError) { |
|
307 tty->print_cr("Aborting due to java.lang.OutOfMemoryError: %s", message); |
|
308 fatal(err_msg("OutOfMemory encountered: %s", message)); |
|
309 } |
|
310 |
|
311 if (ExitOnOutOfMemoryError) { |
|
312 tty->print_cr("Terminating due to java.lang.OutOfMemoryError: %s", message); |
|
313 exit(3); |
|
314 } |
305 } |
315 } |
306 } |
316 } |
307 |
317 |
308 static bool error_reported = false; |
318 static bool error_reported = false; |
309 |
319 |