-XX:[+|-]HitachiOutOfMemoryHandling (OutOfMemory handling option)

Format

-XX:+HitachiOutOfMemoryHandling
This option enables the OutOfMemory handling functionality.
-XX:-HitachiOutOfMemoryHandling
This option disables the OutOfMemory handling functionality.

Description

Specify whether to enable the OutOfMemory handling functionality. This option is valid only when the J2EE server is executed in J2EE server mode.

Use the OutOfMemory handling functionality in combination with the forced termination functionality for OutOfMemory (-XX:+HitachiOutOfMemoryAbort). If the forced termination functionality for OutOfMemory (-XX:-HitachiOutOfMemoryAbort) is disabled, the OutOfMemory handling functionality will be disabled.

If the OutOfMemory handling functionality is enabled, the OutOfMemoryError throwing condition is determined when OutOfMemory occurs. Specifically, if OutOfMemory occurs due to Java heap or Perm heap shortage during the following processing, the functionality determines whether to continue executing the J2EE server:

After determining, if the J2EE server continues execution, the java.lang.OutOfMemoryError is thrown and only the request processing where OutOfMemory occurred is cancelled.

JavaVM performs the following operations based on the determined results. However, if java.lang.OutOfMemoryError is caught by a Web application, that processing is followed.

The OutOfMemoryError throwing condition is as follows. Note that when JavaVM does not conform to the OutOfMemoryError throwing conditions, JavaVM is terminated forcibly by the forced termination functionality for OutOfMemory.

OutOfMemoryError throwing conditions
When OutOfMemory occurs and if all the following conditions are applicable, JavaVM is said to satisfy the OutOfMemoryError throwing conditions and throws java.lang.OutOfMemoryError without terminating abnormally.
  • The OutOfMemory error was caused by a Java heap or Perm heap shortage.
  • The OutOfMemory error occurred in the request processing during the execution of the Web applications (Servlets or JSPs) on the Web container, processing during the execution of the Enterprise Bean invoked from an EJB client application, processing during the execution of the Message-driven Bean, or processing during the execution of the Enterprise Bean invoked from Timer Service.
  • The throw OutOfMemoryError exclusion condition is not applicable.
Throw OutOfMemoryError exclusion condition
The total value (including the current OutOfMemory) of the occurrence counts of the OutOfMemory error caused by the Java heap shortage and the Perm heap shortage occurring within the past one hour from the time when the current OutOfMemory error occurred is greater than the value specified in the -XX:HitachiOutOfMemoryHandlingMaxThrowCount option.

The following table describes the operations for the cause of OutOfMemory occurrence for the forced termination functionality for OutOfMemory and OutOfMemory handling functionality. The enabling of the OutOfMemory handling functionality impacts the operations to be performed when the cause of OutOfMemory is a Java heap or Perm heap shortage.

Table 16-8 Operations for the cause of OutOfMemory occurrence of the forced termination functionality for OutOfMemory and OutOfMemory handling functionality

Causes of OutOfMemory occurrenceIs an operation performed for the forced termination functionality for OutOfMemory
(Operations to be performed during OutOfMemory #1)
Is an operation performed for the OutOfMemory handling functionality
(Operations to be performed during OutOfMemory)
Java heap shortageAn operation is performed
(JavaVM is terminated forcibly).
An operation is performed
(an operation is performed according to the determined results#2).
Perm heap shortageAn operation is performed
(JavaVM is terminated forcibly).
An operation is performed
(an operation is performed according to the determined results#2).
C heap shortageAn operation is performed
(JavaVM is terminated forcibly).
An operation is not performed
(JavaVM is terminated forcibly#3).
UnkownAn operation is not performed
(java.lang.OutOfMemoryError is thrown).
An operation is not performed
(java.lang.OutOfMemoryError is thrown).
Thread LimitAn operation is not performed
(java.lang.OutOfMemoryError is thrown).
An operation is not performed
(java.lang.OutOfMemoryError is thrown).
#1
This operation is performed when the OutOfMemory handling functionality is disabled (-XX:-HitachiOutOfMemoryHandling).
#2
If the OutOfMemoryError throwing condition is satisfied, java.lang.OutOfMemoryError is thrown. If the OutOfMemoryError throwing condition is not satisfied, the processing shifts to the forced termination functionality for OutOfMemory and JavaVM is terminated forcibly.
#3
JavaVM is terminated forcibly by the forced termination functionality for OutOfMemory.

Also, if the OutOfMemory handling functionality is enabled, the information related to the frequency of OutOfMemory occurrence is output to the JavaVM log file when the OutOfMemory error occurs due to a Java heap and Perm heap shortage.

Default value
  • -XX:-HitachiOutOfMemoryHandling
Prerequisite options
  • -XX:+HitachiOutOfMemoryAbort

Output format

[id][Thread: thread_id]<date>[Handling: oom_count(max_oom_count)]

The following is a description of the output contents:

id
OMH (Identifier of the Java VM log file).
thread_id
Thread ID (tid output to the thread dump).
date
Date when OutOfMemory was handled.
oom_count
The total value (including the current OutOfMemory) of the occurrence count of the OutOfMemory error caused by a Java heap shortage and a Perm heap shortage occurring within the past one hour from the time when the current OutOfMemory error occurred.
However, including the current OutOfMemory, even if the total value of the occurrence count within an hour exceeds 3601, the maximum value of the output items is 3601.
max_oom_count
Value specified in the -XX:HitachiOutOfMemoryHandlingMaxThrowCount option.

Examples of output

[OMH][Thread: 0x00927f48]<Tue Aug 24 19:02:19 2010>[Handling: 1(60)]

Precautions