Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/391.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 数百个JBoss 5.1系统线程一直在等待_Java_Threadpool_Jboss5.x - Fatal编程技术网

Java 数百个JBoss 5.1系统线程一直在等待

Java 数百个JBoss 5.1系统线程一直在等待,java,threadpool,jboss5.x,Java,Threadpool,Jboss5.x,大约3个月前,我们迁移到JBoss 5.1.0.GA,测试几天后,我们在应用程序的日志中发现了几个内存不足错误(OOME) 然后将原因描述为版本7之前JVM中的一个bug。我们更新到了7u25版本,没有看到更多的OOME,但现在我看到了异常巨大的线程数:大约2k个线程,其中1.9k是守护进程线程 在检查我们的监控工具后,我发现它们都是JBoss系统线程池生成的线程(它们都被命名为JBoss系统线程(1)-XXXX)。以下是堆栈跟踪详细信息: "JBoss System Threads(1)-16

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

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

在检查我们的监控工具后,我发现它们都是JBoss系统线程池生成的线程(它们都被命名为JBoss系统线程(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>

JBoss系统线程
系统线程
60000
3200
3200
跑

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

该系列没有问题。只是你有一个很大的线程集合。你的线程在做什么,为什么不终止?我相信你只是配置了一个错误的线程池。一旦应用程序经历了高负载,它就会启动所有线程,并且永远不会终止它们。必须限制核心池大小和超时。我的应用程序也有同样的问题,我相信管理员能够通过配置来解决它。@happymeal对于stacktrace,我想他们只是在等待work@MarkoTopolnik我用线程池配置更新了这个问题。尽管它没有解释为什么所有线程池都挂起,3200个线程显然是多余的:-)你至少可以解决这个问题。