1

"remoting-jmx client-thread-4" daemon prio=6 tid=0x000000000f86b000 nid=0x20e0 >waiting on condition [0x000000000b82e000] java.lang.Thread.State: TIMED_WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00000000ebd8bcc0> (a >java.util.concurrent.SynchronousQueue$TransferStack) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226) at >java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQue>ue.java:460) at >java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.j>ava:359) at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942) at >java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068) at >java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at >java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

Here in this thread dump, we have thread Nid. This Nid how can i get it from a thread in java code.

1
  • You can't. There is no API for it. Commented Sep 15, 2015 at 6:55

1 Answer 1

1

Here is a gist which shows how to obtain the NID if you can include lombok.jarfrom project lombok and sa-jdi.jar from the JDK in your app.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.