I have a swing application that freezes after some (random) time. I have taken 5 thread snapshots every 10 seconds after it freezes and they all contain these exact same lines:
"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);
where:
a, b and c are local BigDecimal variables.MATH_CONTEXT is a public final static variable, only accessed within XXX.javaMy questions (answering any of them would be great help)
RUNNABLE state)?Is this evidence of a deadlock or liveness issue (the thread does not seem to make progress but it is in
RUNNABLEstate)?
I doubt it. Since the program freezes, there clearly is an issue. However, I doubt there's a deadlock involving the code you've shown.
Is this the likely reason for the freeze or should I look somewhere else?
I think it's likely that this is a red herring, and the problem lies elsewhere.
What would be the next step to solve the problem?
I personally would look into potential memory allocation and garbage collection issues. In particular, I would make sure the program isn't spending all of its time collecting garbage and therefore failing to make progress.
To do this, I'd use a memory profiler.
While I am at it, I would also monitor the overall CPU and memory usage of the process, and page fault statistics (to see if there's excessive swapping).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With