Hitachi

uCosminexus Application Server Maintenance and Migration Guide


2.5.4 If JavaVM Terminates abnormally

The actions when JavaVM terminates abnormally and the information output in the case of abnormal termination are described below:

Organization of this subsection

(1) Actions in the case of abnormal termination

In UNIX, in the case of abnormal termination, perform actions in the following order. Further, these actions are not required in Windows.

  1. Execute the javatrace command on the machine where abnormal termination occurs.

    Output the javatrace.log file. For the execution method of the javatrace command, see 4.18 JavaVM stack trace information.

  2. Send the acquired javatrace.log file to maintenance personnel along with the error report file (hs_err_pidprocess-ID.log).

    For the method of acquiring the error report file, see 4.11 JavaVM Output Message Logs (Standard Output or Error Report File).

  3. Execute the following commands to create the archive file for the JavaVM executable file, the library loaded when the error occurred, and the core dump.

    • In AIX

      Execute the snapcore command. An archive file compressed with the pax command is created.

    • In Linux

      If the compress command is installed, execute the car_tar_Z command. An archive file compressed with the compress command is created.

      If the gzip command is installed, execute the car_tar_gz command. An archive file compressed with the gzip command is created.

  4. Send the created archive file to maintenance personnel.

(2) Information output at the time of abnormal termination

The information output when the following kind of abnormal termination occurs in JavaVM is described below:

(a) When C heap is insufficient during JavaVM processing

If C heap is insufficient, in continuation to the following messages, the memory status, Java heap information and stack trace information are output to the standard output and error report file (hs_err_pidprocess-ID.log). After that, JavaVM is forcefully terminated.

Check the output information and take an appropriate action.

Exception in thread thread-name java.lang.OutOfMemoryError:requested size-required-for-securing-memory bytes [for message-for-internal-investigation].

(b) When an OutOfMemoryError occurs due to a reason other than insufficient C heap during JavaVM processing

When setting -XX:+HitachiOutOfMemoryAbort as the option when starting the J2EE server, and when an OutOfMemoryError occurs due to the following causes, output the message and perform forced termination of JavaVM. Check the output information and take an appropriate action.

When the OutOfMemory handling functionality is enabled (when -XX:+HitachiOutOfMemoryHandling is set), if an OutOfMemoryError occurs due to Java heap insufficiency or insufficient metaspace area, JavaVM might not be forcibly terminated.

Causes for forced termination
  • Java heap insufficiency

  • Insufficient metaspace area

  • Insufficient C heap in J2SE class library

Further, when C heap is insufficient in the JavaVM process, perform forced termination regardless of the specification of this option.

When terminating, output the following message.

java.lang.OutOfMemoryError occurred.
JavaVM aborted because of specified -XX:+HitachiOutOfMemoryAbort options.
Forced termination timing

The timing when JavaVM is terminated forcefully differs depending on the option settings.

  • When -XX:+HitachiOutOfMemoryStackTrace is specified as the option, terminate after performing output of the stack trace. However, even when registering the process that is to be executed at JavaVM termination time by the java.io.File.deleteOnExit method and the java.lang.Runtime.addShutdownHook method beforehand, perform forced termination without executing these.

  • When setting -XX:+HitachiOutOfMemoryAbortThreadDump as the option, terminate after performing output of the thread dump. Especially, when the cause is Java heap insufficiency or insufficient metaspace area, if -XX:+HitachiOutOfMemoryAbortThreadDumpWithJHeapProf is also set as an option, JavaVM is terminated after the thread dump with statistical information according to the class is output.

Operation when the OutOfMemory Handling functionality is enabled

If -XX:+HitachiOutOfMemoryHandling is set in addition to -XX:+HitachiOutOfMemoryAbort as an option when starting a J2EE server, the OutOfMemory handling functionality gets enabled. In this case, if there is a Java heap insufficiency or insufficient metaspace area, a process to determine whether to perform forced termination is executed by OutOfMemory handling. As a result of this judgment process, if all of the following OutOfMemoryError throw conditions are satisfied, forceful termination is not executed.

OutOfMemoryError Throw Conditions
  • OutOfMemory occurs due to Java heap insufficiency or insufficient metaspace area.

  • OutOfMemory occurs in either the request processing in which the Web application (Servlet/JSP) on the Web container is running, the processing in which the Enterprise Bean invoked from an EJB client application is running, the processing in which a Message-driven Bean is running, or the processing in which the Enterprise Bean invoked from the TimerService is running.

  • Does not correspond to the OutOfMemoryError throw exclusion condition.

OutOfMemoryError Throw exclusion condition

The total number of OutOfMemory occurrences due to Java heap insufficiency and OutOfMemory occurrences due to insufficient metaspace area (including the current OutOfMemory occurrence) within the past hour from the time when the current OutOfMemory occurred is greater than the value specified in the -XX:HitachiOutOfMemoryHandlingMaxThrowCount option.

For details, see -XX:[+|-]HitachiOutOfMemoryHandling (OutOfMemory handling option) in the uCosminexus Application Server Definition Reference Guide.

If the OutOfMemory handling functionality is enabled, whenever OutOfMemory occurs due to Java heap insufficiency or insufficient metaspace area, information on the frequency of OutOfMemory occurrences is output to the JavaVM log file.

(c) When an internal logical error occurred

When an internal logical error occurs, the message showing the JavaVM information where the error occurred, the examination error ID and the thread where the error occurred are output to the standard output and the error report file (hs_err_pidprocess-ID.log). Send the output information to maintenance personnel.