查看cpu占有率

1.查看cpu占有率

top -P

2.查看进程cpu占用率

 ps -mp 3749 -o THREAD,tid,time|sort -rn|head -n 20

查看占用cpu高,且占用时间长的线程

$.线程ID转换为16进制格式

printf "%x\n" tid

3.查看java堆栈信息

su - nobody -c "/usr/java/jdk1.6.0_21/bin/jstack 3749|grep 34d8 -A 30"  34d8替换成上面转换的16进制

注意:这里要使用程序启动的用户执行此命令

使用root会提示:

Unable to open socket file: target process not responding or HotSpot VM not loaded

The -F option can be used when the target process is not responding

4.分析结果

posted @ 2018-08-02 16:47  wuchangsoft  阅读(450)  评论(0编辑  收藏  举报