Java线程问题
上次更新后(我在其中找不到任何犯罪行为),我的应用程序在工作 1-2 小时后开始挂起。我分析了我的应用程序:一切正常,但一段时间后我看到了:
热点:
线程监视器:
它可能是什么?我不知道,因为 Tomcat 日志不包含错误,而且我看不到操作堆栈(只有直接 JVM 调用
- 参见图片)。此外,我在这个 Tomcat 上还有另一个应用程序,它(另一个应用程序)仍然可以完美运行。
有什么想法吗?
After last update (I can't find nothing criminal in it) my appication starts hang on after 1-2 hours of work. I profiled my app: everything was ok, but after some time I see this:
Hot spots:
Thread monitor:
What it can be? I have no idea, because Tomcat log doesn't contain errors and I can't see stack of operation (only direct JVM call
- see at picture). Moreover, I have another application at this Tomcat, and it (another application) still perfectly works.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是您的 HTTP 连接器线程池,有大量等待线程是完全正常的。
有关更多详细信息,请参阅此问题:Apache Tomcat 请求线程。
您的表不是很清楚,但看起来消耗了应用程序 88% 的执行时间 - 它们没有使用 88% 的系统 CPU 时间 - 毕竟,它们正在等待线程。
使用库存设置,实际上有 25 个等待线程(请参阅链接的问题)。 2 小时内 404 秒 / 25 秒似乎并不过分。这相当于每小时大约 8 秒的 CPU 时间。
更有可能的是,您只是在新添加的同步功能中遇到了并发问题 - 您可能应该发布一个特定于该问题的问题 - 如果其他应用程序继续运行,那么您的问题看起来并不在于 Tomcat 或线程池。
更新
来源:http://geekexplains.blogspot。 com/2008/07/threadstate-in-java-blocked-vs-waiting.html
That's your HTTP connector thread pool, it's perfectly normal to have a number of waiting threads.
See this question for more details: Apache Tomcat Request Threads.
Your table isn't very clear, but it looks like that consumed 88% of the execution of your app - they're not using 88% of the system's CPU time - after all, they're waiting threads.
Using stock settings, there are actually 25 waiting threads (see the linked question). 404 seconds / 25 over 2 hours doesn't seem excessive. That's around 8 seconds of CPU time per hour.
It's more likely that you just have a concurrency problem with your newly added synchronized functionality - you should probably post a question specific to that - it doesn't look like your issue is with Tomcat or it's thread pool if the other app continues to function.
Update
Source: http://geekexplains.blogspot.com/2008/07/threadstate-in-java-blocked-vs-waiting.html