java应用cpu占用过高问题分析及解决方法-创新互联

使用jstack分析java程序cpu占用率过高的问题

创新互联主营灵山网站建设的网络公司,主营网站建设方案,成都App定制开发,灵山h5成都小程序开发搭建,灵山网站营销推广欢迎灵山等地区企业咨询

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                                                                                      
15848 root   15  0 6889m 5.7g 4864 S 13.0 9.1 460:25.17 java                                                                                      
15611 root   15  0 6889m 5.7g 4864 S 12.7 9.1 468:17.77 java                                                                                      
15613 root   15  0 6889m 5.7g 4864 S 11.7 9.1 479:40.45 java                                                                                      
15743 root   15  0 6889m 5.7g 4864 S 11.7 9.1 443:04.80 java                                                                                      
15612 root   15  0 6889m 5.7g 4864 S 11.0 9.1 453:43.68 java                                                                                      
15965 root   15  0 6889m 5.7g 4864 S 10.3 9.1 371:00.33 java                                                                                      
15490 root   15  0 6889m 5.7g 4864 S 7.7 9.1 255:32.74 java                                                                                      
15587 root   15  0 6889m 5.7g 4864 S 7.3 9.1 282:27.58 java                                                                                      
15590 root   15  0 6889m 5.7g 4864 S 7.3 9.1 205:48.37 java                                                                                      
15491 root   15  0 6889m 5.7g 4864 R 6.3 9.1 279:09.08 java                                                                                      
15689 root   15  0 6889m 5.7g 4864 S 5.7 9.1 251:42.36 java                                                                                      
16935 root   15  0 6889m 5.7g 4864 S 5.7 9.1 190:34.37 java                                                                                      
15665 root   15  0 6889m 5.7g 4864 S 5.3 9.1 250:07.34 java                                                                                      
16920 root   15  0 6889m 5.7g 4864 S 5.3 9.1 241:34.50 java                                                                                      
15671 root   15  0 6889m 5.7g 4864 S 5.0 9.1 239:49.97 java                                                                                      
15492 root   15  0 6889m 5.7g 4864 S 4.7 9.1 210:23.09 java                                                                                      
14322 root   16  0 6889m 5.7g 4864 S 4.3 9.1 107:39.61 java                                                                                      
14316 root   16  0 6889m 5.7g 4864 S 4.0 9.1 107:18.43 java                                                                                      
14317 root   16  0 6889m 5.7g 4864 S 4.0 9.1 107:29.13 java                                                                                      
15591 root   15  0 6889m 5.7g 4864 S 4.0 9.1 114:34.90 java                                                                                      
14313 root   16  0 6889m 5.7g 4864 S 3.7 9.1 107:12.70 java                                                                                      
14314 root   15  0 6889m 5.7g 4864 S 3.7 9.1 107:28.05 java                                                                                      
14319 root   16  0 6889m 5.7g 4864 S 3.7 9.1 107:27.43 java                                                                                      
14321 root   15  0 6889m 5.7g 4864 S 3.3 9.1 108:01.12 java                                                                                      
15589 root   15  0 6889m 5.7g 4864 R 3.0 9.1 109:01.91 java                                                                                      
15615 root   15  0 6889m 5.7g 4864 S 3.0 9.1 114:55.29 java                                                                                      
16808 root   15  0 6889m 5.7g 4864 S 2.7 9.1 279:05.03 java                                                                                      
14315 root   15  0 6889m 5.7g 4864 S 2.0 9.1 107:45.00 java                                                                                      
14320 root   15  0 6889m 5.7g 4864 S 2.0 9.1 107:48.30 java                                                                                      
15489 root   15  0 6889m 5.7g 4864 S 1.7 9.1 57:38.46 java                                                                                      
15670 root   15  0 6889m 5.7g 4864 S 1.3 9.1  5:55.43 java                                                                                      
14318 root   15  0 6889m 5.7g 4864 S 0.7 9.1 107:45.88 java                                                                                      
14826 root   15  0 6889m 5.7g 4864 S 0.7 9.1 25:07.64 java

网页名称:java应用cpu占用过高问题分析及解决方法-创新互联
网站路径:http://azwzsj.com/article/cohsje.html