大约3个月前,我们迁移到JBoss 5.1.0.GA,测试几天后,我们在应用程序的日志中发现了几个Out of Memory Errors(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)
我还检查了工具中的收集泄漏,并发现了我认为有些相关的下一个数据:
我已经检查了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>
答案 0 :(得分:1)
线程是由池创建的,因为运行服务器的Java版本不兼容。我们切换到早期版本,问题就消失了。