English 中文(简体)
线索倾弃分析(AWT- EventQueue可运行但条件等待)
原标题:Thread dump analysis (AWT-EventQueue runnable but waiting on condition)

我有一个秋千应用程序,在有些(随机)时间后冻结。我每冻结10秒钟就拍5个短片,它们都包含相同的线条:

"AWT-EventQueue-0" prio=6 tid=0x0000000009949000 nid=0x7bec waiting on condition [0x000000000ebbc000]
  java.lang.Thread.State: RUNNABLE
      at java.math.BigInteger.valueOf(Unknown Source)
      at java.math.BigDecimal.inflate(Unknown Source)
      at java.math.BigDecimal.add(Unknown Source)
      at uk.co.xx.xxx.xxxx.XXX$4.get(XXX.java:171)

Note that no other thread in the thread dump is in XXX.java. The corresponding code line (XXX.java:171) looks somewhat inoffensive:

a = a.add(b.multiply(c, MATH_CONTEXT), MATH_CONTEXT);

此处:

  • a, b and c are local BigDecimal variables.
  • MATH_CONTEXT is a public final static variable, only accessed within XXX.java

我的问题 " /强 " (回答其中任何问题都大有帮助)

  • Is this evidence of a deadlock or liveness issue (the thread does not seem to make progress but it is in RUNNABLE state)?
  • Is this the likely reason for the freeze or should I look somewhere else?
  • What would be the next step to solve the problem?
最佳回答

这是否是僵局或生存问题的证据(线条似乎没有取得进展,而是在Runnable state)?

我怀疑,既然计划冻结了,显然有一个问题。然而,我怀疑你所展示的代码陷入了僵局。

这是冻结的原因吗? 还是我该找别的地方?

我认为,这很可能是一种红色的火种,问题在别处。

解决问题的下一步是什么?

我个人将研究潜在的记忆分配和垃圾收集问题,特别是确保该方案不会花费全部时间收集垃圾,因此没有取得进展。

要做到这一点,我就要用一个记忆剖析仪

在我参与这项工作期间,我还将监测整个CPU和该过程的记忆使用情况,以及页过错统计(看是否有过度互换)。

问题回答

但我可以描述我从头开始要采取的步骤。

我会尝试附加一个剖析器 检查内存是否在增长, 因为这个系统可以交换内存, 为什么它看起来挂起来, 但我没有。

剖析器还告诉你 如果线索真的挂着 如果挂着的话 似乎挂着的地方

用于个人特征分析的i 使用视像VM。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签