gpt4 book ai didi

java - 数百个 JBoss 5.1 系统线程永远等待

转载 作者:行者123 更新时间:2023-12-01 14:12:32 26 4
gpt4 key购买 nike

大约 3 个月前,我们迁移到 JBoss 5.1.0.GA,测试几天后,我们在应用程序的日志中发现了几个内存不足错误 (OOME)。

然后I found an issue将原因描述为 JVM 版本 7 之前的错误。我们更新到版本 7u25,我们没有看到更多 OOME,但现在我看到异常庞大的线程数:大约 2k 个线程,其中 1.9k 个是守护线程。

查看我们的监控工具后发现,它们都是JBoss系统线程池生成的线程(它们都被命名为JBoss System Threads(1)-XXXX)。这是堆栈跟踪详细信息:

"JBoss System Threads(1)-1649" Id=130217 in WAITING on lock=java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@a4d1d3
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

我还检查了收集泄漏工具,并找到了我认为有些相关的下一个数据:

Collection Leak Info

我检查了 JBoss JIRA 但没有找到相关的内容。

有人可以告诉我发生了什么事吗?

更新:

这里是jboss-service.xml中的线程池配置

<!-- A Thread pool service -->
<mbean code="org.jboss.util.threadpool.BasicThreadPool"
name="jboss.system:service=ThreadPool">
<attribute name="Name">JBoss System Threads</attribute>
<attribute name="ThreadGroupName">System Threads</attribute>
<!-- How long a thread will live without any tasks in MS -->
<attribute name="KeepAliveTime">60000</attribute>
<!-- The max number of threads in the pool -->
<attribute name="MaximumPoolSize">3200</attribute>
<!-- The max number of tasks before the queue is full -->
<attribute name="MaximumQueueSize">3200</attribute>
<!-- The behavior of the pool when a task is added and the queue is full.
abort - a RuntimeException is thrown
run - the calling thread executes the task
wait - the calling thread blocks until the queue has room
discard - the task is silently discarded without being run
discardOldest - check to see if a task is about to complete and enque
the new task if possible, else run the task in the calling thread
-->
<attribute name="BlockingMode">run</attribute>
</mbean>

最佳答案

线程是由池创建的,因为运行服务器的 Java 版本不兼容。我们切换到早期版本,问题就消失了。

关于java - 数百个 JBoss 5.1 系统线程永远等待,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18385441/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com