1.先写一段程序
public class Test {
public static void main(String[] args) throws InterruptedException {
int i=0;
while(true){
System.out.println("Hello world !"+i);
i++;
Thread.sleep(100);
}
}
}
1.ps -ef |grep java 找出最耗性能的JAVA进程 2.top -Hp 《进程ID》找出最耗时间的JAVA线程 3.printf “%x/n” 《PID》转换成16进制 4.jstack 《进程ID》 |grep 《线程ID》 "main" prio=10 tid=0x00007fdc58009800 nid=0x6a8 waiting on condition [0x00007fdc5e198000]