7.8.1 -XX:[+|-]HitachiOutOfMemoryAbort
-XX:[+|-]HitachiOutOfMemoryAbort specifies whether to enable the functionality that forcibly terminates processing when an OutOfMemoryError occurs.
Description
If an OutOfMemoryError occurs due to one of the following reasons, -XX:[+|-]HitachiOutOfMemoryAbort outputs a message to the standard output and then forcibly terminates processing:
-
JavaHeap shortage
-
Metaspace shortage
-
Compressed Class Space shortage
-
C heap shortage in the J2SE class library
Note that, if a C heap shortage occurs during Java VM processing, the processing is forcibly terminated regardless of the specification of this option.
- Java VM exit code when processing is forcibly terminated
-
6
Note, however, that if the processing was executed on a UNIX shell (such as sh and csh), the exit code is 0x86, which is calculated by adding 0x80 to 6.
Syntax
-XX:[+|-]HitachiOutOfMemoryAbort
Specifiable values
Type: String
- -XX:+HitachiOutOfMemoryAbort
-
Forcibly terminates the processing when an OutOfMemoryError occurs.
- -XX:-HitachiOutOfMemoryAbort
-
Does not forcibly terminate the processing even when an OutOfMemoryError occurs.
Example
java.lang.OutOfMemoryError occurred. JavaVM aborted because of specified -XX:+HitachiOutOfMemoryAbort options.
Notes
-
If the -XX:+HitachiOutOfMemoryStackTrace option is specified, the stack trace is output to the Java VM log file and then processing is terminated.
-
When an OutOfMemoryError occurs, the core dump is output to the current directory.
-
If this option is specified, the processing will be forcibly terminated. At this time, the Java VM termination processing that is registered by using the methods java.io.File.deleteOnExit and java.lang.Runtime.addShutdownHook will not be executed.