java - 为什么 java.exe 由于“org.xnio.nio”线程而消耗更多 CPU?
问题描述
我们正在运行带有 JDK 1.8 版本的 WildFly 12。由于 java.exe 的高 CPU 使用率(90% 以上),我们的 Web 应用程序面临门户关闭/缓慢问题。然后,我们使用 JStack 进行了线程转储,大多数高 CPU 线程都指向“org.xnio.nio”
门户在HTTPS中运行
CPU: 8核
总内存: 24 GB
分配的 JVM 内存:从 1 GB(最小)到 5 GB(最大)
进行线程转储时占用的 JVM 内存: 4 GB
数据库在单独的机器上
以下是线程转储结果(高 CPU 线程):
"default I/O-1" #95 prio=5 os_prio=0 tid=0x00000000260bf800 nid=0x1988 runnable [0x000000002e49f000]
java.lang.Thread.State: RUNNABLE
at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:147)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:59)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
at io.undertow.conduits.ReadTimeoutStreamSourceConduit$2.readReady(ReadTimeoutStreamSourceConduit.java:89)
at io.undertow.protocols.ssl.SslConduit$SslReadReadyHandler.readReady(SslConduit.java:1145)
at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
"default I/O-13" #108 prio=5 os_prio=0 tid=0x0000000022186000 nid=0x2310 runnable [0x000000002f09f000]
java.lang.Thread.State: RUNNABLE
at java.lang.Object.notifyAll(Native Method)
at sun.nio.ch.WindowsSelectorImpl$StartLock.startThreads(WindowsSelectorImpl.java:189)
- locked <0x00000006618ae440> (a sun.nio.ch.WindowsSelectorImpl$StartLock)
at sun.nio.ch.WindowsSelectorImpl$StartLock.access$300(WindowsSelectorImpl.java:181)
at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:153)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked <0x000000066508ea18> (a sun.nio.ch.Util$3)
- locked <0x000000066508ea08> (a java.util.Collections$UnmodifiableSet)
- locked <0x0000000665082b98> (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:551)
"default I/O-13" #108 prio=5 os_prio=0 tid=0x0000000022186000 nid=0x2310 runnable [0x000000002f09e000]
java.lang.Thread.State: RUNNABLE
at java.util.AbstractCollection.toArray(AbstractCollection.java:183)
at sun.nio.ch.Util$3.toArray(Util.java:322)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:570)
- locked <0x000000066508ea18> (a sun.nio.ch.Util$3)
- locked <0x0000000665082b98> (a sun.nio.ch.WindowsSelectorImpl)
"default I/O-5" #100 prio=5 os_prio=0 tid=0x00000000260c0000 nid=0x858 runnable [0x000000002e89e000]
java.lang.Thread.State: RUNNABLE
at org.xnio.nio.WorkerThread.run(WorkerThread.java:480)
该问题发生 (2 - 5) 天一次。
提前致谢
解决方案
推荐阅读
- apache-spark - Spark 内部结构:项目的好处
- laravel-5 - 我如何在表单提交时将员工表 ID(自动递增)提交到员工 ID 下的用户表
- java - 从另一个类更新摆动组件
- android - Firebase设置值将错误的键放在已发布的应用程序上
- scala - 使一个 SBT 子项目任务依赖于另一个子项目任务
- r - 在维护顺序的同时聚合和折叠基于向量
- git - 在桌面目录下做 git init 有什么坏处?
- android - 在Android中,当应用程序处于运行或关闭状态时,是否有适当的方法来检测用户是否添加或删除了指纹?
- kubernetes - Kubernetes Persistent Volumes 删除初始文件
- node.js - 为什么找不到我安装的Node包