A process hang is defined as one of the Application Server processes not responding to requests while the appserv process is still running. On Solaris systems, you can use the appserver_8_hang script to gather debug data in hang situations. See 2.3.1 Running the appserver_8_hang.sh Debugging Script for detailed information about this script.
Make sure that you collect all the data over the same time frame in which the problem occurs. See 2.2 Configuring Solaris OS to Generate Core Files if a core file is not generated.
Collect the following information for process hang problems. Run the commands in the order listed below when the problem occurs. Be sure to specify the time when the process hang happened and affected processes, if possible.
Collect the general system information as explained in To Collect Required Debug Data for Any Application Server Problem.
If your Application Server uses JDK 1.4.2 or higher, verify that the -XX:+PrintClassHistogram Application Server JVM option is enabled.
For more information, see http://docs.sfbay.sun.com/source/819-0215/jvm.html.
For the Solaris platform, use the ptree command on any of the following processes, depending on the component for which you want to collect data.
ps -ef | grep appservDAS
ps -ef | grep appserv
Sample DAS Output
ptree 21293 21293 /export/home/as81ur2-02/lib/appservDAS domain1 21299 /bin/sh /export/home/as81ur2-02/imq/bin/imqbrokerd -javahom 21309 /export/home/pablo/as81ur2-02_caixa/jdk/bin/java -server -cp /export/ |
Collect data on the lowest PID process for the DAS, which in this example is 21293, or the highest PID for the instance, which is in this example is 178.
Sample Instance Output
ptree 171 171 ./bin/sh /export/home/as82p1/nodeagents/draco.spain.sun.com/instac 173 /export/home/as82p1/lib/appservLauncher /export/home/as82 178 /export/home/as82p1/lib/appserv instacia_draco |
Run the netstat command and save the output.
netstat -an | grep appserv-port
netstat -an
For Solaris and Application Server 8, run the appserv_8_hang.sh script.
The appserv_8_hang.sh script captures the debug data for Solaris and Application Server 8. After running this script, run the pkg_app script on one of the core files generated by the appserv_8_hang.
Run the following commands and save the output.
ps -aux | server-root
vmstat 5 5
iostat -xtopuptime
ps -aux | server-root
vmstat 5 5
iostat -xtopsar
ps -aux | server-root
vmstat 5 5
Obtain the appserv or appservDAS process PID:
C:\windbg-root>tlist.exe |
Obtain the process details of the appserv or appserveDAS running process PID:
C:\windbg-root>tlist.exe appserv_PID |
Get the swap information.
swap -l
swapinfo
free
Already provided in C:\report.txt.
(Solaris only) If you are able to isolate the hung process, collect the following debug data for that process.
Using the PID obtained in Step 3, above, get a series of five of the following commands (one every ten seconds):
pstack appserv-pid pmap -x appserv-pid |
Additionally, collect the outputs from the following commands:
prstat -L -p appserv-pid pfiles appserv-pid pmap appserv-pid |
Get a Java Stack trace from the either appserv or appservDAS process.
ptree 171 171 ./bin/sh /export/home/as82p1/nodeagents/draco.spain.sun.com/instac 173 /export/home/as82p1/lib/appservLauncher /export/home/as82 178 /export/home/as82p1/lib/appserv instacia_draco kill -3 178 |
The kill -3 dumps a Java stack trace for the server.log file.
Gather core files and the output of the following commands.
If a process hangs, it is helpful to compare several core files to review the state of the threads over time. Rename the core file, wait for approximately one minute, then rerun the following commands. In this way you can collect a series of core files without subsequent files overwriting each other. Do this three times to obtain three core files.
For HP-UX, you need the PHKL_31876 and PHCO_32173 patches to use the gcore command. If you cannot install these patches, use the HP-UX /opt/langtools/bin/gdb command from version 3.2 or later, or use the dumpcore command.
Solaris
gcore -o /tmp/appserver-core appserv-pid pstack /tmp/appserver-core |
HP-UX
# cd server-root/lib gcore -p appserv-pid (gdb) attach appserv-pid Attaching to process appserv-pid No executable file name was specified (gdb) dumpcore Dumping core to the core file core.appserv-pid (gdb) quit The program is running. Quit anyway (and detach it)? (y or n) y Detaching from program: , process appserv-pid |
Linux
# cd server-root/lib gdb (gdb) attach appserv-pid Attaching to process appserv-pid No executable file name was specified (gdb) gcore Saved corefile core.appserv-pid (gdb)backtrace (gdb)quit |
Windows
Get the appserv process PID:
C:\windbg-root>tlist.exe |
Generate a crash dump on the appserv running process PID:
C:\windbg-root>adplus.vbs -hang -p appserv-pid -o C:\crashdump_dir |
For Windows, provide the complete generated folder under C:\crashdump_dir.
For Solaris, archive the result of the pkg_app script (at least one core file is required).
./pkg_app.ksh application_pid corefile |
Make sure that the appropriate limitations are set by using the ulimit command, and that the user ID is not nobody. Also check the coreadm command for additional control. See 2.2 Configuring Solaris OS to Generate Core Files if a core file is not generated.