JConsole 线程选项卡 - 了解信息

发布于 2024-08-07 23:50:39 字数 768 浏览 3 评论 0原文

我正在运行 JBoss 5。我发现内存保留随着时间的推移而增加。 活动线程的数量正在增加。以下堆栈跟踪取自活动线程,该线程是许多线程之一(这些是随着时间的推移而添加的线程)。 我可以从堆栈跟踪中了解到什么?我怎样才能更深入、更清楚地了解正在发生的事情?

名称: WorkManager(2)-92 状态:等待 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@4e2e52 阻塞总数:1 等待总数:1

堆栈跟踪: sun.misc.Unsafe.park(本机方法) java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925) java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) java.lang.Thread.run(Thread.java:619)

谢谢, 杆

I'm running JBoss 5. I see that memory keep is increasing as time pass.
The number of active threads are increasing. The following stacktrace is taken from an active thread which is one of many threads (These are the threads that are being added as time pass).
What can i learn from the stacktrace? How can I go deeper and have clearer view of what is going on?

Name: WorkManager(2)-92
State: WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@4e2e52
Total blocked: 1 Total waited: 1

Stack trace:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
java.lang.Thread.run(Thread.java:619)

Thanks,
Rod

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

剩余の解释 2024-08-14 23:50:39

该线程看起来像是在等待 getTask(),即它只是在等待一些工作要做。

随着请求的到来,新的线程将会产生,你不应该担心它,除非有大量的线程忙于实际工作。

内存使用量会随着时间的推移而增加,直到 JVM 决定对其中的一部分进行垃圾收集。如果它持续增长,并且从 jconsole 运行 GC 没有任何区别,则可能存在内存泄漏。查找泄漏可能很困难,但您可以使用 MAT 使其变得更容易。

That thread looks like it's waiting for getTask(), ie it's just waiting for some work to do.

New threads will spawn as requests come in, you shouldn't worry about it unless there's a huge number of threads busy with actual work.

Memory usage will grow over time until the JVM decides to garbage collect some of it. If it keeps growing, and running GC from jconsole makes no difference, it's possible you have a memory leak. Finding leaks can be difficult, but you could use MAT to make it easier.

终遇你 2024-08-14 23:50:39

通过从 JDK1.6 或 JDK1.7 运行 JConsole,您将了解更多信息。 JDK1.5 中的 JConsole.exe 是“老派”。

You will learn more from this by running the JConsole from JDK1.6 or JDK1.7 . The JConsole.exe in JDK1.5 is "old-school".

妳是的陽光 2024-08-14 23:50:39

I'd suggest that you start by profiling with jvisualvm. You'll get graphs over time of heap usage, threads, garbage collection, etc.

You can also take a heap dump with jmap, and then analyze with jhat or mat.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文