I run jstack on a java process (oracle jdk1.7_072) and found these lines
"C2 CompilerThread1" daemon prio=10 tid=0x00007f1a8415d000 nid=0x7d72 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" daemon prio=10 tid=0x00007f1a8415a000 nid=0x7d71 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
I know that C2 is a bytecode compiler. I have three questions:
nid
parameter mean? The first one nid=0x7d72
looks similar to java version, is it coincidence or not?-XX:CICompilerCount=N
JVM option.nid
(Native ID) is a unique ID of a thread given by OS. On Linux it is a number returned by gettid(). In your case TID = 0x7d72 = 32114.[0x0000000000000000]
here is not related to waiting on condition
. What is printed in brackets is a stack pointer of the last known Java stack frame aligned to a page size. Since compiler thread is not a real Java thread, it does not have last Java SP, hence zero is printed.