`

解决all threads are currently busy

阅读更多
这2天系统宕机了5次,查看后台日志发现tomcat报all threads are currently busy。

把tomcat的最大线程调到500,依然没解决问题。

于是用jconsole连接上服务器,发现所有的空闲线程都被以下代码占用:

ExtAlarmMonitorAction.loadAlarmData()

查看该方法,发现如下代码:
    while(null==cb){
        Thread.sleep(500);
        cb = getCurrentConditionBean();
    }

在某些场景下,永远无法获得cb,于是该线程被无限期占用。tomcat新创建的空闲线程,也很快被占满,直到最大线程数溢出。

修改死循环代码后,重新发布测试,系统没有再出现宕机现象。问题解决。
分享到:
评论

相关推荐

    linux实用脚本show-busy-java-threads

    本文将深入探讨标题所提及的三个实用脚本:“show-busy-java-threads”、“show-duplicate-java-classes”以及“find-in-jars”。这些脚本都是针对Java开发者和系统管理员的利器,旨在提高效率和解决问题。 1. **...

    show-busy-java-threads.sh文件

    `show-busy-java-threads.sh`脚本就是为了帮助开发者快速定位和排查这类性能问题而设计的。这个脚本主要用于监控并展示Java应用程序中的繁忙线程,从而帮助我们理解程序的执行状态,找出可能导致高CPU负载的原因。 ...

    show-busy-java-threads

    上传到 linux线上服务器,执行 chmod -R 777 show-busy-java-threads 执行权限。 ./show-busy-java-threads 查看执行占用cpu偏高的 线程,方便我们排查定位。

    show-busy-java-threads.sh

    java线程定位脚本

    jboss-threads-3.1.0.Final-API文档-中文版.zip

    赠送jar包:jboss-threads-3.1.0.Final.jar; 赠送原API文档:jboss-threads-3.1.0.Final-javadoc.jar; 赠送源代码:jboss-threads-3.1.0.Final-sources.jar; 赠送Maven依赖信息文件:jboss-threads-3.1.0.Final....

    Java.Threads.and.the.Concurrency.Utilities.1484216997

    Threads and the Concurrency Utilities helps all Java developers master and use these capabilities effectively. This book is divided into two parts of four chapters each. Part 1 focuses on the Thread...

    POSIX Threads Programming

    Implementations that adhere to this standard are referred to as POSIX threads, or Pthreads. <br>The tutorial begins with an introduction to concepts, motivations, and design considerations for ...

    show-busy-java-threads-jvm-cpu.rar

    `show-busy-java-threads.sh` 文件提供了一个实用的脚本,帮助我们查看那些导致Linux系统CPU占用率升高的Java线程。 首先,让我们了解什么是JVM。JVM(Java Virtual Machine)是Java程序的运行环境,它负责解释和...

    show-busy-threads

    此命令通过结合Linux操作系统的ps命令和jvm自带的jstack命令,查找Java进程内CPU利用率最高的线程,一般适用于服务器负载较高的场景,并需要快速定位导致负载高的原因。

    Node.js-worker-threads-pool轻松管理Node.js工作线程池

    为了解决这个问题,Node.js 10.5.0版本引入了worker_threads模块,允许开发者利用多核处理器的优势,通过工作线程(Worker Threads)进行并行计算。 "worker-threads-pool" 是一个专门为Node.js设计的库,它的目的...

    C语言Threads等程序(Use P-threads)

    本主题聚焦于使用C语言在Linux环境下实现线程编程,主要涉及了P-threads库,这是一种在Unix和类Unix系统中实现线程API的标准。下面将详细阐述相关知识点。 1. **C语言与线程编程**: C语言虽然没有内置的多线程支持...

    Working with Ruby Threads

    - **互斥锁与内存可见性**:互斥锁不仅解决了数据竞争问题,还解决了内存可见性问题,即确保线程间正确地同步内存中的数据变化。 - **互斥锁性能**:互斥锁本身具有一定的开销,不当使用可能会导致性能下降。因此,...

    jboss-threads-3.1.0.Final-API文档-中英对照版.zip

    赠送jar包:jboss-threads-3.1.0.Final.jar; 赠送原API文档:jboss-threads-3.1.0.Final-javadoc.jar; 赠送源代码:jboss-threads-3.1.0.Final-sources.jar; 赠送Maven依赖信息文件:jboss-threads-3.1.0.Final....

    Programming with POSIX Threads

    Programming with POSIX Threads

    螺纹查询软件threads汉化版

    螺纹查询软件threads汉化版 螺纹查询软件threads汉化版

Global site tag (gtag.js) - Google Analytics