4.9.2 Acquiring J2EE Server Memory Dump
This section describes how to acquire a J2EE server memory dump for each OS.
- Organization of this subsection
(1) In Windows
If the J2EE server is running (if the cjstartsv process exists), collect the memory dump from the task manager#.
If the J2EE server is running and you want to forcibly stop it and acquire the memory dump, execute the cjstopsv command with the -fd option specified.
If the J2EE server is down, collect the memory dump from the Windows debug tool#.
- #
-
For details, see the Microsoft website.
To acquire the memory dump when the J2EE server is down, you need to specify settings in advance. For details on how to specify the settings, see 3.3.15 Settings for Collecting a User Dump.
(2) In UNIX
When the cjstartsv process is down, acquire a core dump output in the working-directory/ejb/server-name.
When restarting the cjstartsv process, the names of the core dump files are renamed in core.output-date-time# (in AIX) or core.process-ID.output-date-and-time# (in Linux). The core dumps are not saved by overwriting when re-starting the cjstartsv process, therefore, you can save the core dumps generated when errors occur.
- #
-
The output date and time is output in the YYMMDDhhmmss format.
YY: Western calendar year (Last 2 digits) MM: Month (2 digits) DD: Day (2 digits)
hh: Hour (2 digits in 24 hour notation) mm: Minute (2 digits) ss: Seconds (2 digits)
Note that you can set the upper limit value for the core dumps to be saved. In Windows, when restarting the cjstartsv process and executing the javacore command, starting from the oldest, the core dump is deleted in the order of output date and time. In UNIX, when the total size of the core dump files output to the working-directory/ejb/server-name exceeds the upper limit value, the core dump files are deleted in the order of output date and time starting from the oldest. The upper limit value is specified in ejb.server.corefilenum of the J2EE server extension parameter in the <configuration> tag of the logical J2EE server (j2ee-server) in the Easy Setup definition file. Note that the files are deleted during restart of the cjstartsv process. For details about setting the upper limit value for number of core files, see 3.3.16 Settings for Acquiring a Core Dump.
After acquiring a core dump, execute the javatrace command to acquire only the stack trace information from the core dump. The stack trace information is the information required for investigating the cause of abnormal termination of JavaVM. For details about how to acquire the stack trace information, see the section 4.18 JavaVM stack trace information.
You can acquire a core dump in the following cases. How to acquire a core dump for each case is described below:
-
Acquiring a core dump when the cjstartsv process is running
Acquiring a core dump when the cjstartsv process (J2EE server) is running, confirm the process ID of the cjstartsv process and execute the kill command. Execute the kill command in the following format. Note that the process terminates when the kill command is executed. Hitachi, therefore, recommends that you execute the kill command before restarting.
kill -6 cjstartsv-process-ID
-
Acquiring a core dump and thread dump concurrently in a running Java process
Execute the javacore command to acquire a core dump and thread dump concurrently in the running Java process. The execution format of the javacore command is described below. Note that for the options that can be specified, see javacore (Acquiring the core file and thread dump/in UNIX) in the uCosminexus Application Server Command Reference Guide.
javacore process-ID
The following message is output if you execute the command in the above-mentioned format.
send SIGQUIT to 8662: ? (y/n)
If you enter y, javacore process-ID.output-date-and-time.core (core dump) and javacore process-ID.output-date-and-time.txt (thread dump) is output to the current directory from where the Java program is being executed. If you enter n, the command is terminated without acquiring the core dump and thread dump.
When acquiring a core dump and thread dump, the following message is output by the Java program being executed. Note that the information in Italics is not actually displayed.
Now generating core file (javacore8662.030806215140.core)... done (output of core dump and thread dump terminated) Writing Java core to javacore8662.030806215140.txt... OK