tomcat在一台电脑上运行出现一两个小时后cpu占用从0%到18%并一直这样 5C

系统版本 windows server 2008 R2 64位
JDK 1.8.0_162-win32
Tomcat-9.0.5-win32
数据库 MySQL 5.7.21-win32

图片说明

            32线程 32g内存
            问题描述:在一台以上配置的电脑,开启一两个小时后cpu占用从0%变成18%,没有定时任务,有6个线程都占用3.11%的cpu(在其他电脑上系统版本和jdk tomcat mysql版本一样未出现该种情况)
            通过jstack吧进程发现以下6个线程占用cpu,没有发现与业务代码的关联


            "ajp-nio-28009-ClientPoller-1" #47 daemon prio=5 os_prio=0 tid=0x169a4000 nid=0x3e4c runnable [0x1d73f000]

java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:296)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl.java:278)
at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:159)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked (a sun.nio.ch.Util$3)
- locked (a java.util.Collections$UnmodifiableSet)
- locked (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:710)
at java.lang.Thread.run(Thread.java:748)

Locked ownable synchronizers:
- None
"ajp-nio-28009-ClientPoller-0" #46 daemon prio=5 os_prio=0 tid=0x169a3c00 nid=0x81064 runnable [0x1d52f000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl.resetWakeupSocket0(Native Method)
at sun.nio.ch.WindowsSelectorImpl.resetWakeupSocket(WindowsSelectorImpl.java:473)
- locked (a java.lang.Object)
at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:174)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked (a sun.nio.ch.Util$3)
- locked (a java.util.Collections$UnmodifiableSet)
- locked (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:710)
at java.lang.Thread.run(Thread.java:748)

Locked ownable synchronizers:
- None

"http-nio-28080-ClientPoller-0" #32 daemon prio=5 os_prio=0 tid=0x17b34400 nid=0x687dc runnable [0x1cb0f000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl.resetWakeupSocket0(Native Method)
at sun.nio.ch.WindowsSelectorImpl.resetWakeupSocket(WindowsSelectorImpl.java:473)
- locked (a java.lang.Object)
at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:174)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked (a sun.nio.ch.Util$3)
- locked (a java.util.Collections$UnmodifiableSet)
- locked (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:710)
at java.lang.Thread.run(Thread.java:748)

Locked ownable synchronizers:
- None
"http-nio-28080-ClientPoller-1" #33 daemon prio=5 os_prio=0 tid=0x17b34800 nid=0xb3230 runnable [0x1cc5f000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl.resetWakeupSocket0(Native Method)
at sun.nio.ch.WindowsSelectorImpl.resetWakeupSocket(WindowsSelectorImpl.java:473)
- locked (a java.lang.Object)
at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:174)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked (a sun.nio.ch.Util$3)
- locked (a java.util.Collections$UnmodifiableSet)
- locked (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:710)
at java.lang.Thread.run(Thread.java:748)

Locked ownable synchronizers:
- None

"NioBlockingSelector.BlockPoller-2" #14 daemon prio=5 os_prio=0 tid=0x15a96000 nid=0x48494 runnable [0x1669f000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:296)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl.java:278)
at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:159)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked (a sun.nio.ch.Util$3)
- locked (a java.util.Collections$UnmodifiableSet)
- locked (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.apache.tomcat.util.net.NioBlockingSelector$BlockPoller.run(NioBlockingSelector.java:298)

Locked ownable synchronizers:
- None
"NioBlockingSelector.BlockPoller-1" #13 daemon prio=5 os_prio=0 tid=0x15a8ec00 nid=0x8b6c8 runnable [0x1664f000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:296)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl.java:278)
at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:159)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked (a sun.nio.ch.Util$3)
- locked (a java.util.Collections$UnmodifiableSet)
- locked (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.apache.tomcat.util.net.NioBlockingSelector$BlockPoller.run(NioBlockingSelector.java:298)

Locked ownable synchronizers:
- None

0

1个回答

64位系统,又那么多内存,为什么用MySQL 5.7.21-win32,这是32bit的版本,应该用64bir的才好。看下是不是内存垃圾回收影响了性能。

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!