7.8.6 -XX:[+|-]HitachiOutOfMemoryStackTrace
-XX:[+|-]HitachiOutOfMemoryStackTrace outputs the exception information and stack trace to the Java VM log file when an OutOfMemoryError occurs.
Description
-XX:[+|-]HitachiOutOfMemoryStackTrace specifies whether to output the exception information and stack trace to the Java VM log file when an OutOfMemoryError occurs.
- Format of output
-
[id] [Thread:thread_id]<date>[java.lang.OutOfMemoryError : requested size bytes (cause) : reason : thread_count threads exist] [id] [Thread:thread_id] stack_trace
The following provides details about the output.
Output item
Output content
id
OOM (Java VM log file identifier).
thread_id
Thread ID (the tid that is output to the thread dump).
date
Date and time when the OutOfMemory exception occurred.
size
Size (in bytes) of the memory that was to be allocated. This information is not output when the -XX:-HitachiOutOfMemorySize option is specified.
In the following cases, the requested memory size cannot be collected, and unknown is output instead of the size:
-
When the Java memory allocation functionality is not used and an OutOfMemoryError is explicitly thrown
This includes errors that are thrown by the standard class library. For example, if an error is thrown by processing such as throw new OutOfMemoryError();, the memory size cannot be output.
-
When an OutOfMemoryError is caused by verifier during class loading
cause
Exception cause type#. This information is not output if the -XX:-HitachiOutOfMemoryCause option is specified.
reason
Exception reason. This information is output when thread creation fails.
thread_count
Number of threads when the OutOfMemoryError occurred. This value includes the number of threads that could not be created.
stack_trace
Stack trace.
- #:
-
The exception cause types are as follows.
Table 7‒8: List of exception cause types No.
Cause message
Description
1
C Heap
Exception caused when allocating a C heap
2
Java Heap
Exception caused when allocating a Java heap
3
Meta Space
Exception caused when allocating Metaspace
4
Compressed Class Space
Exception caused when allocating Compressed Class Space
5
Unknown
Exception that cannot be identified as one of the above exceptions
6
Thread Limit
Exception caused when the maximum number of threads is specified in the -XX:HitachiThreadLimit option and the number of created threads exceeds the specified maximum number.
-
Syntax
-XX:[+|-]HitachiOutOfMemoryStackTrace
Specifiable values
Type: String
- -XX:+HitachiOutOfMemoryStackTrace
-
Outputs the exception information and stack trace to the Java VM log file when an OutOfMemoryError occurs.
The stack trace is stored in the buffer for each stack and then output after the code is converted. The stack trace is output each time an OutOfMemoryError is thrown. Therefore, if an OutOfMemoryError is caught and then thrown again, the stack trace is output multiple times. Note that, if an OutOfMemoryError occurs during thread creation, no stack trace is output.
- -XX:-HitachiOutOfMemoryStackTrace
-
Does not output the stack trace to the Java VM log file when an OutOfMemoryError occurs.
Example
[OOM][Thread: 0x00062fd0] <Wed Mar 17 00:41:17 2004> [java.lang.OutOfMemoryError :requested 400000 bytes.(C Heap): unable to create thread : 1500 threads exist] [OOM][Thread: 0x00062fd0] at java.lang.Thread.start(Native Method) [OOM][Thread: 0x00062fd0] at sub1.<init>(Thread0012.java:22) [OOM][Thread: 0x00062fd0] at Thread0012.test01(Thread0012.java:73) [OOM][Thread: 0x00062fd0] at Thread0012.main(Thread0012.java:57)
Notes
If Java VM fails to create a thread because of a memory shortage, only the exception information will be output. The stack trace will not be output.