windows 下使用mina通信框架运行一段时间后CPU占用率就剧增,现根据CPU占用比例查询对应的Dump日志的线程是下面几个占用很高,求问具体原因和解决思路
"NioBlockingSelector.BlockPoller-0" #14 daemon prio=5 os_prio=0 tid=0x0000000056b36800 nid=0x1b80 runnable [0x000000005833f000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl.resetWakeupSocket0(Native Method)
at sun.nio.ch.WindowsSelectorImpl.resetWakeupSocket(Unknown Source)
- locked <0x00000000f03db9c0> (a java.lang.Object)
at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
- locked <0x00000000f03d2590> (a sun.nio.ch.Util$3)
- locked <0x00000000f03d2580> (a java.util.Collections$UnmodifiableSet)
- locked <0x00000000f03d2410> (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(Unknown Source)
at org.apache.tomcat.util.net.NioBlockingSelector$BlockPoller.run(NioBlockingSelector.java:340)
Locked ownable synchronizers:
- None
"NioDatagramAcceptor-3" #24 prio=5 os_prio=0 tid=0x0000000058a68800 nid=0x18cc runnable [0x000000005dd8f000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source)
at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
- locked <0x00000000f12fb5f0> (a sun.nio.ch.Util$3)
- locked <0x00000000f12fb5e0> (a java.util.Collections$UnmodifiableSet)
- locked <0x00000000f12fb490> (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(Unknown Source)
at org.apache.mina.transport.socket.nio.NioDatagramAcceptor.select(NioDatagramAcceptor.java:745)
at org.apache.mina.transport.socket.nio.NioDatagramAcceptor$Acceptor.run(NioDatagramAcceptor.java:162)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- <0x00000000f140ff78> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"http-nio-8080-ClientPoller-1" #45 daemon prio=5 os_prio=0 tid=0x00000000571cd800 nid=0x1788 runnable [0x000000005f34f000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source)
at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
- locked <0x00000000f1452418> (a sun.nio.ch.Util$3)
- locked <0x00000000f1452408> (a java.util.Collections$UnmodifiableSet)
- locked <0x00000000f1452388> (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(Unknown Source)
at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:849)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"NioSocketAcceptor-1" #22 prio=5 os_prio=0 tid=0x0000000058a67000 nid=0x18c0 runnable [0x000000005d21f000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source)
at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
- locked <0x00000000f12ff900> (a sun.nio.ch.Util$3)
- locked <0x00000000f12ff8f0> (a java.util.Collections$UnmodifiableSet)
- locked <0x00000000f12ff420> (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(Unknown Source)
at sun.nio.ch.SelectorImpl.select(Unknown Source)
at org.apache.mina.transport.socket.nio.NioSocketAcceptor.select(NioSocketAcceptor.java:281)
at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:454)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- <0x00000000f12ff1a8> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"http-nio-8080-ClientPoller-0" #44 daemon prio=5 os_prio=0 tid=0x00000000571cd000 nid=0x1aa4 runnable [0x000000005f67e000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl.resetWakeupSocket0(Native Method)
at sun.nio.ch.WindowsSelectorImpl.resetWakeupSocket(Unknown Source)
- locked <0x00000000f145d260> (a java.lang.Object)
at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
- locked <0x00000000f1451068> (a sun.nio.ch.Util$3)
- locked <0x00000000f1451058> (a java.util.Collections$UnmodifiableSet)
- locked <0x00000000f1450fd8> (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(Unknown Source)
at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:849)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
是不是有内存泄漏造成的,检查一下。