java cup占用高分析脚本
甘明朗
2023-12-01
[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