1. public class Test {  
  2.     public static void main(String[] args) throws InterruptedException {  
  3.         int i=0;  
  4.         while(true){  
  5.             System.out.println("Hello world !"+i);  
  6.             i++;  
  7.             Thread.sleep(100);  
  8.         }  
  9.     }  
  10. }  

 

java代码执行过慢的问题定位

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]

java代码执行过慢的问题定位

 

另外一些APM工具也可以帮助进行性能定位

http://blog.csdn.net/neutrojan/article/details/50532590

 

相关文章:

  • 2021-09-30
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2023-03-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-21
  • 2021-07-30
  • 2021-05-01
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
相关资源
相似解决方案