Thread Dump Analysis Pattern

Thread Dump Analysis Pattern

Threads in ‘runnable’ state consume CPU. So when you are analyzing thread dumps for high CPU consumption, threads in ‘runnable’ state should be thoroughly reviewed. Typically, in thread dumps several threads are classified in ‘RUNNABLE’ state. But in reality several of them wouldn’t be actually running, rather they would be just waiting. But still, JVM classifies them in ‘RUNNABLE’ state. You need to learn to differentiate from really running threads with pretending/misleading RUNNABLE threads.

Example

Below is the real world thread dump excerpt. In these stack traces, threads aren’t actually in ‘RUNNABLE’ state, i.e. they are not actively executing any code. They are just waiting on the sockets to read or write. It’s because JVM doesn’t really know what thread is doing in a native method, JVM classifies them in ‘RUNNABLE’ state. Real running threads would consume CPU, whereas these threads are on I/O wait, which don’t consume any CPU.

WorkerThread#27[10.201.1.55:56893] - priority:10 - threadId:0x00002b59983cb000 - nativeId:0x4482 - addressSpace:null - state:RUNNABLEstackTrace:	java.lang.Thread.State: RUNNABLE	at java.net.SocketInputStream.socketRead0(Native Method)	at java.net.SocketInputStream.__AW_read(SocketInputStream.java:129)	at java.net.SocketInputStream.read(SocketInputStream.java)	at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)	at java.io.BufferedInputStream.read(BufferedInputStream.java:237)	- locked  (a java.io.BufferedInputStream)	at java.io.DataInputStream.readByte(DataInputStream.java:248)	at org.jboss.jms.server.remoting.ServerSocketWrapper.checkConnection(ServerSocketWrapper.java:94)	at org.jboss.remoting.transport.socket.ServerThread.acknowledge(ServerThread.java:857)	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:585)	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)multicast receiver,GATES-RefData-Infinispan-Cluster,matcamupa67-vm-46719 - priority:10 - threadId:0x00002b597c1ba800 - nativeId:0x3034 - addressSpace:null - state:RUNNABLEstackTrace:	java.lang.Thread.State: RUNNABLE	at java.net.PlainDatagramSocketImpl.receive0(Native Method)	- locked  (a java.net.PlainDatagramSocketImpl)	at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:145)	- locked  (a java.net.PlainDatagramSocketImpl)	at java.net.DatagramSocket.receive(DatagramSocket.java:725)	- locked  (a java.net.DatagramPacket)	- locked  (a java.net.MulticastSocket)	at org.jgroups.protocols.UDP$PacketReceiver.__AW_run(UDP.java:675)	at org.jgroups.protocols.UDP$PacketReceiver.run(UDP.java)	at java.lang.Thread.run(Thread.java:662) 

Tool to analyze thread dumps: http://fastthread.io/.

Share the Post:
XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing

data dictionary

Tools You Need to Make a Data Dictionary

Data dictionaries are crucial for organizations of all sizes that deal with large amounts of data. they are centralized repositories of all the data in organizations, including metadata such as