Sie sind auf Seite 1von 5

Welcome, Guest

Login
Register
Getting Started
Newsletters
Store

Products
Services & Support
About SCN
Downloads
Industries
Training & Education
Partnership
Developer Center
Lines of Business
University Alliances
Events & Webinars
Innovation

(JSTTSG)(Deploy)Thread Dump
Added by Ina Ivanova, last edited by Shimon Zafrir on Jul 10, 2012

Overview
You are using AS Java and want to create a thread dump from all Java threads running on a server process.
This page describes how to perform a thread dump and how to locate the collected information.

You have to create 3 consecutive thread dumps at a short interval of time (e.g. 5 seconds).

How can I generate thread dumps ?


Using the SAP Management Console
Using JCMon
On Unix
On Windows
On IBM i
Without having console on Windows (Java 1.4 or 5)

Using the SAP Management Console


Step 1
Open SAP(M)MC.

Step 2
Go to AS Java Process Table view.
Step 3
Right click on the server process for which you want to create a thread dump and select Dump Stack Trace.
If you are not sure which is the right server process, create thread dumps for all server processes.
Step 4
Wait for at least 5 seconds.
Step 5
Make another dump (until you have the 3 dumps).
In case you want to make dumps for all server processes, you should have 3*<number of nodes> dumps.

Using JCMon
The JCMon must be started with adm user in order to have the correct environment (for example LD_LIBRARY_PATH).

Step 1
Start the JCMon program with the profile of the instance.
The JCMon binary is located into one of the following directories:
/usr/sap/<SID>/<Instance>/j2ee/os_libs

Page 1 of 5

/usr/sap/<SID>/SYS/exe/run directory.
Example: >jcmon.exe pf=C:\usr\sap\N71\SYS\profile\N71_JC02_sofd60135707
Netweaver Versions 6.40-7.0x
Step 2
Enter "20" to go to the "Local Administration Menu".
Step 3
Choose the "Dump stacktrace" menu item by entering its number.
Step 4
Select the server process from the list of processes above (the table just above the menu items) and enter the value from the "Idx" column.
Step 5
Confirm the command with a "y" if the selected server process is correct.
Netweaver Versions 7.10 and higher versions:
Step 2
Enter "30" to go to the "Solid Rock Administration Menu".
Step 3
Choose the "Dump call stacks" menu item by entering 10
Step 4
Select the server process from the list of processes above (the table just above the menu items) and enter the value from the "Idx" column.
Step 5
Confirm the command with a "y" if the selected server process is correct.

Using JSMon
Getting thread dump via JSMon tool is applicable to SAP NetWeaver 7.1 EHP1 and higher versions.

Start the JSMon program with the profile of the instance.


>jsmon pf=/usr/sap/<SID>/SYS/profile/<SID_Instance_NostName>
The JSMon binary is located in the following path:
/usr/sap/<SID>/<Instance>/exe
directory or in the:
/usr/sap/<SID>/SYS/exe/uc/<OS_Name>
directory.
In the started prompt please follow the steps:
Page 2
1) Get the index of the process which will create a full thread dump
> process view
2) Create full thread dump (on Netweaver 7.11)
> process vmdump <idx>
On Netweaver 720 and higher:
> process sdump <idx>
After completion, you will find the thread dump in the
/usr/sap/<SID>/<Instance>/work/std_<node name>.out file
The thread dump could be found in the file system of the application
server under location /usr/sap/<SYS>/<INSTANCE>/work/dev_sever[0..n] or
std_server[0..n].

Where are the generated thread dumps?


The location of the generated thread dump is JVM dependent:
For JVMs from SUN, SAP and HP - /usr/sap/<SID>/<Instance>/work/std<node name>.out_'
For JVMs from IBM /usr/sap/<SID>/<Instance>/j2ee/cluster/serverX/javacore.<timestamp>.<PID>.txt
If you have problems locating the thread dump, it is a good idea to have a look at the various files in the work folder. After you triggered the thread dump, sort the files in the work folder by date. Then open the most recent
ones and look for the words dump and thread.
In case the process is not AS Java but some SL tool like sl_auto, SAPInst or JSPM, please see this page .

Alternative procedures
On Unix
Step 1
Start the JCMon program with the profile of the instance.
Step 2
Enter "20" to go to the "Local Administration Menu".
Step 3
Note the process ID (PID) from the server process.
Step 4
Issue a "kill -3 <PID>" command from the shell.
Step 5
Find the generated thread dump (see the section above).

On Windows
This procedure is not applicable for double stack installations (R/3 and AS Java running in the same instance).

Page 2 of 5

Step 1
Open the SAP Management Console.
Step 2
Navigate to the Process table of the Java instance.
Step 3
Right-click on the server process and from the context menu, choose "Dump Stack Trace".

On IBM i
Step 1
Log on as QSECOFR or a user with similar authorization.
Step 2
To check the Java processes in your subsystem, enter command WRKACTJOB SBSR3(<instance_number>).
Jobs labeled "PGM-JLAUNCH" in column "Function" are Java processes. In earlier support packages, those processes had the job name "JLAUNCH", with higher SP levels, they have job names "SDM", "DISPATCHER",
"SERVER0" etc. Substitute <name> in the following lines accordingly.
Step 3
Press function key F11 twice to get the user und the process number of the JVMs (job name <name>). These values are needed to create a Java thread dump.
Step 4
To create the Java thread dump, enter command:
DMPJVM JOB(<process_number>/<job user>/<name>) STACKFRAME(*ALL)
DMPJVM creates a spool file. In this spool file you can find not only all Java threads dumps, but also the heap stack and the class loader information. DMPJVM does not stop a running JVM. This means that you can create a
Java thread dump at any time without stopping a JVM.
Step 5
To look at the created spool file, enter command WRKSPLF. Use the function key F11 to collect the following information: file number, job name and job number.
Step 6
Create a text file containg the needed Java thread dump information to make the information accessible also to users of other operation systems.

Perform the next steps on your Windows PC.

Unattach the file getJavaDumpFile.TXT from


SAPNote 710154
into a temporary directory on your Windows PC.
Rename the file to getJavaDumpFile.bat.
Run the batch file to get a file called javadump.txt containing the Java thread dumps:
getJavaDumpFile.bat <iSeries_hostname> <QSECOFR> <QSECOFR_password> <spoolfile_name> <file_number> <job_name> <job_number>
Example: _getJavaDumpFile.bat as0096 QSECOFR secret QDMPJVM 2 QPADEV0004 QSECOFR 060594_

Using jstack
If you are running Sun/SAP Java EE 6 (Windows and Linux) or Java EE 5 (Linux only) you may use the jps and jstack tools to obtain a thread dump. Executing jps gives a list of all the Java processes on the current host,
along with their process IDs (PID). Executing jstack and providing a PID as the only argument yields a full thread dump of the respective process:

C:\usr\sap\LKG\J92\exe\sapjvm_6\bin>jps
8844 Main
10220 Jps
C:\usr\sap\LKG\J92\exe\sapjvm_6\bin>jstack 8844
2009-01-30 10:26:40
Full thread dump SAP Java Server VM (6.1.0851 Dec 16 2008 05:19:29 - cons - optU - windows x86 - 6 - bas2:113185 (mixed mode)):
"Low Memory Detector" daemon cpu=0.00 [reset 0.00] ms allocated=16272 B (15.89 kB) [reset 16272 B (15.89 kB)]
io= file i/o: 0/0 B, net i/o: 0/0 B, files opened:0, socks opened:0 [reset file i/o: 0/0 B, net i/o: 0/0 B, files opened:0, socks opened:0 ]
prio=6 tid=0x00a4b298 [_thread_blocked (_at_safepoint), stack(0x00e60000,0x00eb0000)] [0x00000000..0x00000000]
java.lang.Thread.State: RUNNABLE
...............
prio=6 tid=0x00624400 [_thread_blocked (_at_safepoint), stack(0x00420000,0x00470000)] [0x0046f000..0x0046fe04]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(J)V(Native Method)
at Main.main([Ljava/lang/String;)V(Main.java:13)
................
"VM Periodic Task Thread" cpu=0.00 [reset 0.00] ms
io= file i/o: 0/0 B, net i/o: 0/0 B, files opened:0, socks opened:0
prio=10 tid=0x00a4caa8
JNI global references: 1105

[reset file i/o: 0/0 B, net i/o: 0/0 B, files opened:0, socks opened:0 ]

C:\usr\sap\LKG\J92\exe\sapjvm_6\bin>

Without having console on Windows (Java 1.4 or 5)


1. Go to http://www.adaptj.com/main/download

Page 3 of 5

2. Clink "Launch" -> will see...

3. Process (drop down menu) -> Select -> <choose java process> OK (button)
4. Process (drop down menu) -> Thread Dump
5. Done
NOTE: This doesn't always work. If you are connected to the target system via terminal connection (i.e. mstsc - remote desktop) you might need to perform some additional steps. For more info see the tool
documentation. If possilbe always use the standard tools that come with the JVM (jps and jstack)

How to read Thread Dump file(s)?


Open the thread dump file (read "Where are the generated thread dumps?" section if you are not able to locate the thread dump file).
For the given sample Notepad.exe is used.

1. Go to the bottom of the file the and perform search for "Full thread dump SAP Java Server"

Note
The search is performed from BOTTOM to TOP of the file in order to locate the last thread dump

2. Put the cursor in the beginning of the thread dump

3. Scroll the file until you reach the end of thread dump

Page 4 of 5

4. Copy/paste the thread dump information into new file


5. Perform a search in the new file that contains only the thread dump for keywords you are looking for.
E.g. to locate and analyze the Deployment threads look for:
DeployThread
com.sap.engine.services.dc
com.sap.engine.services.deploy

6. For two or more thread dump files compare the called classes and at which row the class is called in order to determine if the process is still running or is
hanging.

Follow SCN
Contact Us
SAP Help Portal

Privacy
Terms of Use
Legal Disclosure
Copyright

Page 5 of 5

Das könnte Ihnen auch gefallen