-2

I have a thread dump. Now, I want to know how many threads are running, what is their run time, what is its current state. I don't want to use third party tools. I need a java code which takes dump file as input and shows the o/p.The main purpose is to find how long the threads were waiting.I want to find the threads with longest wait time!!

Teja MS
  • 290
  • 2
  • 5

1 Answers1

2

Use jvisualvm.It comes with your JDK.

enter image description here

rghome
  • 8,529
  • 8
  • 43
  • 62
  • After Loading the thread dump file , its just showing all threads with thread id,priority,nid,state .But I want the execution time. Atleast I need when it has been created . – Teja MS Dec 04 '18 at 09:23
  • The main purpose is to find how long the threads were waiting.I want to find the threads with longest wait time!! – Teja MS Dec 04 '18 at 09:38
  • Sorry, but if it isn't showing that information I don't know how to get it. – rghome Dec 04 '18 at 10:13