Linux下,Java进程占用CPU超100%
[root@localhost bin]# top
top - 07:01:38 up 19:03, 2 users, load average: 1.10, 1.10, 1.04
Tasks: 168 total, 1 running, 167 sleeping, 0 stopped, 0 zombie
Cpu(s): 11.9%us, 1.9%sy, 0.0%ni, 85.6%id, 0.5%wa, 0.0%hi, 0.1%si, 0.0%st
Mem: 16282908k total, 4298384k used, 11984524k free, 205972k buffers
Swap: 8208376k total, 0k used, 8208376k free, 719380k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
28857 root 20 0 6286m 836m 11m S 106.9 5.3 396:27.97 java
1 root 20 0 19228 1516 1224 S 0.0 0.0 0:02.51 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:00.02 migration/0
[root@localhost ~]# top -H -p 28857
top - 07:08:02 up 19:10, 2 users, load average: 1.08, 1.08, 1.04
Tasks: 26 total, 1 running, 25 sleeping, 0 stopped, 0 zombie
Cpu(s): 12.0% us, 1.9% sy, 0.0% ni, 85.5% id, 0.5% wa, 0.0% hi, 0.1% si, 0.0% st
Mem: 16282908k total, 4297380k used, 11985528k free, 206304k buffers
PID USER PR NI VIRT RES SHR S %CPU%MEM TIME+ COMMAND
28871 root 20 0 6286m 836m 11m R 101.8 5.3 365:20.04 java
7749 root 20 0 6286m 836m 11m S 6.0 5.3 3:12.11 java
28857 root 20 0 6286m 836m 11m S 0.0 5.3 0:00.00 java
28858 root 20 0 6286m 836m 11m S 0.0 5.3 0:02.52 java
28859 root 20 0 6286m 836m 11m S 0.0 5.3 0:41.45 java
[root@localhost ~]# jstack 28857 > a.txt
从打印出来的堆栈信息文件(a.txt)里,找到该进程(28871)信息:
Thread 28871: (state = IN_NATIVE)
- sun.nio.ch.ServerSocketChannelImpl.accept0(java.io.FileDescriptor, java.io.FileDescriptor, java.net.InetSocketAddress[])@bci=0 (Compiled frame; information may be imprecise)
- sun.nio.ch.ServerSocketChannelImpl.accept() @bci=130, line=226 (Compiled frame)
- org.eclipse.jetty.server.nio.SelectChannelConnector.accept(int) @bci=20, line=97 (Compiled frame)
- org.eclipse.jetty.server.AbstractConnector$Acceptor.run() @bci=153, line=833 (Compiled frame)
- org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(java.lang.Runnable) @bci=1, line=598 (Interpreted frame)
- org.eclipse.jetty.util.thread.QueuedThreadPool$3.run() @bci=47, line=533 (Interpreted frame)
- java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)
看样子,跟这个BUG(http://jira.codehaus.org/browse/JETTY-937)很类似!
下载一个新版本(9.1.2)的jetty(http://download.eclipse.org/jetty/)就好了!
详见:http://blog.csdn.net/sanshiqiduer/article/details/1933625
更多推荐
所有评论(0)