In this article will go through How to download Thread Dump and Heap Dump and location where its stored.

A thread dump is a snapshot of how the Java threads of the running server processes look at a point in time, whereas a heap dump is a snapshot of the memory of a java Process.

There is multiple way to collect Thread Dump from AS Java System, in this blog will see using NWA and JSMon
* Using NWA
* Using XPI Inspector tool
* Using the SAP Management Console
* Using JSMon
* Using the NW Java Support Tool
* Using the SAP JVM Profiler

Using NWA (NetWeaver Administrator):
Thread dumps can be captured through NWA for NW AS Java 7.3 and above systems

Step 1:
Open a browser and access NWA URL http://<AS Java Hostname>:<HTTP Port>/nwa

Step 2:
Navigate to Troubleshooting -> Advanced Troubleshooting -> Thread Dump Analysis
NWA -Thread Dump and Heap Dump

Step3:
Click Generate Thread Dump. Select an option that best suits to your situation. Press OK.

Step 4:
A Thread Dump will be generated that can be downloaded

Similarly, we can download Head Dump trace file also from same way.

Using JSMon:
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:
1) Get the index of the process which will create a full thread dump
> process view

2) Create full thread dump
> process vmdump <idx>
or
> 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].

Similarly we can get a head dump also.

Where are the generated thread dumps?
The location of the generated thread dump is JVM dependent:

For JVMs from SAP, SUN and HP – /usr/sap/<SID>/<Instance>/work/std <node name>.out’
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.

The heap file is written to the working directory of the server, e.g. /usr/sap/<SID>/J<instance>/j2ee/cluster/server<node>/

How to read Thread Dump file(s)?

Open the thread dump file from the location where its generated as mentioned above location.
Open them in Notepad/WordPad or such tool.

1. 1. Go to the bottom of the file the and perform search for “Full thread dump SAP Java Server”
Thread Dump
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 and Scroll the file until you reach the end of thread dump.

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

4. 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

5. 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.
Thread dump

Note: If you unable to find any information or root cause then share the dump file with SAP through OSS message for further troubleshooting.

 

Leave a Reply

Your email address will not be published. Required fields are marked *