我们的大多数 jboss 线程都处于 BLOCKED 状态,并且 jboss 的线程数永远不会下降。
想了解如何减少线程计数以及为什么这么多线程处于 BLOCKED 状态。
我们有 450 个线程中的 380 个处于 BLOCKED 状态。
使用下面的来找出状态
awk '/state / { print $5}' < tdump-231.log | sort | uniq -c
384 BLOCKED)
68 IN_NATIVE)
Thread 31554: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
- java.lang.Object.wait() @bci=2, line=485 (Compiled frame)
- org.apache.tomcat.util.net.JIoEndpoint$Worker.await() @bci=8, line=885 (Compiled frame)
- org.apache.tomcat.util.net.JIoEndpoint$Worker.run() @bci=11, line=911 (Compiled frame)
- java.lang.Thread.run() @bci=11, line=662 (Interpreted frame)
Thread 31553: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
- java.lang.Object.wait() @bci=2, line=485 (Compiled frame)
- org.apache.tomcat.util.net.JIoEndpoint$Worker.await() @bci=8, line=885 (Compiled frame)
- org.apache.tomcat.util.net.JIoEndpoint$Worker.run() @bci=11, line=911 (Compiled frame)
- java.lang.Thread.run() @bci=11, line=662 (Interpreted frame)
Thread 31552: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
- java.lang.Object.wait() @bci=2, line=485 (Compiled frame)
- org.apache.tomcat.util.net.JIoEndpoint$Worker.await() @bci=8, line=885 (Compiled frame)
- org.apache.tomcat.util.net.JIoEndpoint$Worker.run() @bci=11, line=911 (Compiled frame)
- java.lang.Thread.run() @bci=11, line=662 (Interpreted frame)
Thread 31551: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
- java.lang.Object.wait() @bci=2, line=485 (Compiled frame)
- org.apache.tomcat.util.net.JIoEndpoint$Worker.await() @bci=8, line=885 (Compiled frame)
- org.apache.tomcat.util.net.JIoEndpoint$Worker.run() @bci=11, line=911 (Compiled frame)
- java.lang.Thread.run() @bci=11, line=662 (Interpreted frame)
Thread 31550: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
- java.lang.Object.wait() @bci=2, line=485 (Compiled frame)
- org.apache.tomcat.util.net.JIoEndpoint$Worker.await() @bci=8, line=885 (Compiled frame)
- org.apache.tomcat.util.net.JIoEndpoint$Worker.run() @bci=11, line=911 (Compiled frame)
- java.lang.Thread.run() @bci=11, line=662 (Interpreted frame)