1. jps 获取Java进程的PID。
1
jcmd -l
1
2
3
jstack <PID> stack.txt
# 或
jcmd <PID> Thread.print >> stack.txt
1
2
top -H -p <PID>
ps -mp <PID> -o THREAD,tid,time | sort -rn | head -n 10
1
2
echo "obase=16; PID" | bc
printf "%x\n" 73658

SystemTap,LatencyTOP,vmstat, sar, iostat, top, tcpdump

iftop, iptraf, ntop, tcpdump

Java的JProfiler/TPTP/CodePro Profiler

<a href="https://coolshell.cn/articles/7490.html">性能调优攻略</a>

https://coolshell.cn/articles/7490.html/embed#?secret=sGuaIXdcl5

https://www.linuxhot.com/java-cpu-used-high.html

https://linux.cn/article-5633-1.html