6

For example you got a dump like this:

"MyThread" prio=1 tid=0x0850c9f8 nid=0x1baf runnable

what does the nid mean here? Is it a hex value of pid or lwpid?

Sawyer
  • 15,581
  • 27
  • 88
  • 124
  • 2
    i'm gonna guess it means "native id". I know next to nothing about GCJ or GDB though. I just know that Linux threads have pids, and that's the right size for one. – cHao Dec 19 '11 at 15:41
  • 4
    Your question is answered very thoroughly in this one: http://stackoverflow.com/questions/7599608/a-few-questions-about-java-thread-dump. – Tudor Dec 19 '11 at 15:45
  • seems I got an answer from http://java.sys-con.com/node/1611555. nid Native Identifier of the thread. Indicates LWP id in Solaris. Identifier for this process at the OS level. However in this post http://blogs.manageengine.com/appmanager/2011/02/09/identify-java-code-consuming-high-cpu-in-linux-linking-jvm-thread-and-linux-pid (see step 4) the user use pid to search for the dump and found match, why? – Sawyer Dec 19 '11 at 15:46

2 Answers2

9

nid is Native Thread ID : Crucial information as this native Thread Id allows you to correlate for example which Threads from an OS perspective are using the most CPU within your JVM etc.

saurzcode
  • 827
  • 12
  • 30
  • 2
    Yes, but how do you match them up? The "Thread IDs" I see from my running process (in Windows Process Explorer) don't match the nid in my thread dump. I even converted the hex... no matches. – 11101101b Sep 06 '19 at 20:43
7

I think it is the native thread ID (that is, the native process ID).

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521