使用jstack分析java程序cpu占用率过高的有关问题
使用jstack分析java程序cpu占用率过高的问题
1,使用jps查找出java进程的pid,如3707
2,使用top -p 14292 -H观察该进程中所有线程的CPU占用。
[root@cp01-game-dudai-0100.cp01.baidu.com ~]# top -p 14292 -H top - 22:14:13 up 33 days, 7:29, 4 users, load average: 25.68, 32.11, 33.76 Tasks: 113 total, 2 running, 111 sleeping, 0 stopped, 0 zombie Cpu(s): 68.3%us, 6.3%sy, 0.0%ni, 20.2%id, 0.1%wa, 0.2%hi, 4.9%si, 0.0%st Mem: 65965312k total, 65451232k used, 514080k free, 82164k buffers Swap: 975864k total, 972052k used, 3812k free, 9714400k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 15844 root 15 0 6889m 5.7g 4864 S 20.6 9.1 814:13.29 java