java cup占用高分析脚本
[was@dmgr ita-scripts]$ vi java_analys.sh
PID=$1 ; ps -mp $PID -o THREAD,tid,time | awk -F " " '{print $2" "$8}' | grep -v CPU | grep -v "-" | sort -nr | head -1 | awk -F " " '{print $2}' | xargs pri
ntf "%x\n" | while read line ; do TID=$line ;echo $TID ; jstack $PID | grep $TID -A 30 ; done
PID=$1 ; ps -mp $PID -o THREAD,tid,time | awk -F " " '{print $2" "$8}' | grep -v CPU | grep -v "-" | sort -nr | head -1 | awk -F " " '{print $2}' | xargs pri
ntf "%x\n" | while read line ; do TID=$line ;echo $TID ; jstack $PID | grep $TID -A 30 ; done
posted on 2017-07-22 18:12 gavanwanggw 阅读(130) 评论(0) 编辑 收藏 举报