IBM Cloud Authors: Zakia Bouachraoui, Elizabeth White, Yeshim Deniz, Pat Romanski, Liz McMillan

Related Topics: IBM Cloud

IBM Cloud: Article

WebSphere Application Server Java Dumps

Description and problem determination

Example 4 – This example represents the Servlet Engine Transport thread reading the request from the socket provided by the server socket thread.
  • Object Request Broker (ORB) threads – The ORB threads do the Internet Inter-ORB Protocol (IIOP) communication and are responsible for handling Enterprise Bean communication. The ORB thread uses the Java Naming Interface (JNI) to find objects to which it must bind and connect. ORB threads have socket listeners that you’ll see in a Java dump. To understand how the ORB thread works, see the IBM JVM Diagnostics Guides in the references section of this document.
3XMTHREADINFO “ORB.thread.pool:14118” (TID:0x10B1B7B0,
  sys_thread_t:0x45F9BCE0, state:CW, native
ID:0x1624) prio=5
4XESTACKTRACE at java.lang.String.valueOf(String.
  java(Compiled Code))
4XESTACKTRACE at com.trade.eps...getNextInBatch
4XESTACKTRACE at com.trade.eps...getNextInBatch
4XESTACKTRACE at com.trade.eps...getNextInSequence
4XESTACKTRACE at com.trade.eps...setKeyAttributes
4XESTACKTRACE at com.ibm.CORBA.iiop.ORB.process
  (ORB.java(Compiled Code))
4XESTACKTRACE at com.ibm.CORBA.iiop.OrbWorker.
  run(OrbWorker.java(Compiled Code))
4XESTACKTRACE at com.ibm.ejs.oa.pool.
  (Compiled Code))
4XESTACKTRACE at com.ibm.ws.util.CachedThread.
  run(ThreadPool.java(Compiled Code))
Example 5 – This example represents the server ORB thread executing an Enterprise Bean.
  • Java Message Service (JMS) threads – JMS threads use additional threads to do work for message-driven beans. Calls to message-driven beans are asynchronous with respect to an entire application. However, the actual message-driven bean onMessage() method invocation is a synchronous operation that you can view in a Java dump. A message-driven bean onMessage() method call will wait (block) on any I/O that’s being performed, typically another Enterprise Bean call.
  • Miscellaneous threads – WebSphere Application Server contains many other threads that do internal tasks such as alarm threads, thread pool management, and so on.

Initiating Java Dumps on WebSphere Application Server 5.x
You can initiate the WebSphere Application Server Java dumps using the wsadmin tool just follow these steps:
  1. Start the wsadmin tool in the WebSphere/AppServer/bin/wsadmin.sh (or .bat on Windows).
  2. Get a handle on the JVM process for which you want to initiate a dump. Typically this is the WebSphere Application Server process set by default to server1.
  3. Invoke the dumpThreads method using the AdminControl object. The following example demonstrates the code used to do this for a default server1 process once you invoke the wsadmin tool. See the WebSphere Application Server InfoCenter for more information.
wsadmin>set jvm [$AdminControl completeObjectName 
wsadmin>$AdminControl invoke $jvm dumpThreads

Example 6 – This example demonstrates invoking a Java dump using the wsadmin tool. By default these files are generated in the WebSphere/AppServer/ directory. However, you can specify the location using an environment variable supplied to the JDK. For more details on this environment variable, invoking Java dumps using operating system-specific signals, and other options for invoking Java dumps, see the IBM JVM Diagnostics Guides in the reference section of this article.

Types of Problems Detectable by a Java Dump
The following list includes problem indicators in a Java dump. For many of these problems you can use ThreadAnalyzer to detect and determine the cause:
  • Monitors that have a long or longer than usual list of threads waiting for them. They indicate that your application has a larger number of threads waiting on the monitor than it would normally have. If this situation occurs, a bottleneck may exist due to improper monitor use. There’s no set number of threads that indicates this problem because it is dependent on the application, such as the way it handles synchronization. To find and fix this problem, view the monitors listed in the LK subcomponent dump routine (see Looking into Monitors – The LK Dump Routine to understand the LK dump routine). Look for the monitors with an unusually high number of threads waiting on them. For example, if most of the monitors have one or two threads waiting for them compared to those that have six or eight threads waiting on them, it may indicate a performance bottleneck at those resources. If the resource never becomes available, the application may hang. If that happens, follow these steps:
  1. Determine which thread owns the monitor that’s creating the bottleneck by looking at the LK dump routine and singling out the monitor that seems to have the longest (abnormal) list of threads waiting on it. You can identify by the number of threads that follow the text “Waiting to be notified.”
  2. View the XM subcomponent dump routine for the details of the thread that owns the monitor (the one with the large number of waiting threads) by comparing the thread identification (provided in the LK dump routine) with the XM dump routine.
  3. Determine the state of the thread and do one of the following:
  • If the thread is in the runnable state, determine which part of the code is executing by lookingat the stack trace. Many times this section of the code is the bottleneck.
  • If that thread is in a conditional wait state (CW) or monitor wait state (MW), go to the LK subcom    ponent dump routine to see if the thread is waiting for another resource. Repeat the process to find the potential source of the bottleneck.
  • Saturated thread pools – This is a thread pool where the number of executing threads is equal to or greater than the maximum number of threads allocated to it. If a particular thread pool isn’t growable (the isGrowable flag isn’t enabled), a saturated thread pool will show the maximum allocated pool size is already allocated. If the thread pool is growable, then the thread pool is saturated when the server doesn’t perform well due to an overly grown thread pool. When your thread pools are saturated, you can see what is bappening with each of the threads in the thread pool. To figure out which thread pool the thread represents, look at the stack trace to understand the underlying code that calls thread pool workers or the name of the threads in a particular thread pool. For problem determination, it’s important to understand the cause of the thread pool saturation. In many cases, it’s because of a misuse of synchronization practices or poorly configured thread pool size. If you have a synchronization problem, you’ll see that the threads in the thread pool are waiting on a shared resource. Otherwise you may have a poorly configured thread pool size and you should try tuning it.
  • Circular dependencies among threads, such as deadlocks. For each thread, determine the resources that they own and are waiting on based on the information provided in the XM and LK subcomponent dump routines. This information includes the correlation of the TID and sys_thread_t of the thread and the name of the monitor. Determining circular dependencies can be complicated. However, some JDKs and tools such as ThreadAnalyzer do the computations for you automatically.
  • Threads running indefinitely that shouldn’t be running indefinitely. These threads can be seen in a runnable state after taking multiple Java dumps separated by a three-five minute interval. If you look at the stack trace in the XM subcomponent dump routine and the threads are still executing the same part of the code (compare the thread, sys_thread_t, and native thread identifications to all captured Java dumps), it’s possible that these threads will run indefinitely. If other threads are waiting on resources (monitors) that the indefinitely running threads own, then the other threads will hang indefinitely.
  • Threads waiting indefinitely. These threads can be seen waiting for the same resource in multiple Java dumps separated by a three-five minute interval. In this case, identify the resource that the threads are waiting for by comparing the thread name, thread identification, sys_thread_t, and native thread identification for the thread with the captured Java dumps. Typically this is caused by the thread waiting for a monitor that you can see in all the captured Java dumps. If the thread is waiting for a monitor, the state of the thread is either CW or MW and you can find the thread on the LK component dump routine as “Waiting to be notified” or “owned.”

Classloader Problems
If the application experiences problems or errors related to Java classes missing at runtime, determine which class file is missing by looking at the classes that are loaded by the class loader and listed under the CL subcomponent dump routine. If you can’t find the class that’s in the CL subcomponent dump routine, make sure you can find the class in the file system under the appropriate structure. Otherwise, make sure that the class file is being loaded by the proper class loader. For further information, go to the WebSphere Application Server InfoCenter or the references listed below.

ThreadAnalyzer is a problem determination tool for WebSphere Application Server thread performance and deadlock detection. You can use it to obtain a Java dump from an application server and use its analysis features for problem determination. For performance problem determination, ThreadAnalyzer provides a top-of-the-stack (TOS) analysis that counts all of the methods at the top of the stack for the listed threads. It then sorts them by ‘weight’ (automatically computed by ThreadAnalyzer), and lists the possible performance bottlenecks in your application. ThreadAnalyzer does automatic deadlock detection while it analyzes the Java dump.

Downloading ThreadAnalyzer
To download ThreadAnalyzer:
  1. Go to http://www.ibm.com/developerworks/websphere/downloads/thread_analyzer.html
  2. Follow the links to the login. If you don’t have an account, click the “I have not registered before” link.
  3. Follow the rest of the links to download ThreadAnalyzer.
Basic Use of ThreadAnalyzer
To install ThreadAnalyzer, extract the contents of the zip file to anywhere in your file system. To start ThreadAnalyzer make sure you have WebSphere Application Server V4 or V5 installed and then start the tagui.cmd or tagui.sh file located in the <ThreadAnalyzerInstall>/bin directory. For more information on ThreadAnalyzer, see the product documentation provided in the zip file on installation.

    Many thanks for the contributions provided by Steve Eaton, Daniel Julin, and Arvind Srinivasan. 

More Stories By Dipak Patel

Dipak M. Patel is a Senior IT specialist for IBM Software Services Performance Technology group. He has been focused on solving complex performance related problems involving WebSphere Application Server and Business Integration solutions. Dipak has a bachelors degree in Electrical Engineering and a masters degree in Computer Science from the University of Akron.

More Stories By Michel Betancourt

Michel Betancourt has been focused on WebSphere Application Server problem determination while part of IBM’s World Wide WebSphere Solutions War Room team. He was graduated from Florida International University in 2001 with a bachelor’s in computer engineering.

More Stories By Lorrie Barber

Lorrie M. Barber has been in WebSphere Application Server information development since 2001 focusing on system administration. She has a BS in computer information systems from the University of North Carolina at Wilmington and an MS in technical communication from North Carolina State University.

Comments (2)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

IoT & Smart Cities Stories
Moroccanoil®, the global leader in oil-infused beauty, is thrilled to announce the NEW Moroccanoil Color Depositing Masks, a collection of dual-benefit hair masks that deposit pure pigments while providing the treatment benefits of a deep conditioning mask. The collection consists of seven curated shades for commitment-free, beautifully-colored hair that looks and feels healthy.
The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today. According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...
The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today. According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...
We all love the many benefits of natural plant oils, used as a deap treatment before shampooing, at home or at the beach, but is there an all-in-one solution for everyday intensive nutrition and modern styling?I am passionate about the benefits of natural extracts with tried-and-tested results, which I have used to develop my own brand (lemon for its acid ph, wheat germ for its fortifying action…). I wanted a product which combined caring and styling effects, and which could be used after shampo...
The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected pat...
There are many examples of disruption in consumer space – Uber disrupting the cab industry, Airbnb disrupting the hospitality industry and so on; but have you wondered who is disrupting support and operations? AISERA helps make businesses and customers successful by offering consumer-like user experience for support and operations. We have built the world’s first AI-driven IT / HR / Cloud / Customer Support and Operations solution.
Codete accelerates their clients growth through technological expertise and experience. Codite team works with organizations to meet the challenges that digitalization presents. Their clients include digital start-ups as well as established enterprises in the IT industry. To stay competitive in a highly innovative IT industry, strong R&D departments and bold spin-off initiatives is a must. Codete Data Science and Software Architects teams help corporate clients to stay up to date with the mod...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Druva is the global leader in Cloud Data Protection and Management, delivering the industry's first data management-as-a-service solution that aggregates data from endpoints, servers and cloud applications and leverages the public cloud to offer a single pane of glass to enable data protection, governance and intelligence-dramatically increasing the availability and visibility of business critical information, while reducing the risk, cost and complexity of managing and protecting it. Druva's...
BMC has unmatched experience in IT management, supporting 92 of the Forbes Global 100, and earning recognition as an ITSM Gartner Magic Quadrant Leader for five years running. Our solutions offer speed, agility, and efficiency to tackle business challenges in the areas of service management, automation, operations, and the mainframe.