4

I'm using Java Mission Control to profile my application. Amongst the useful metrics in the "Threads" tab is the number of times each thread was blocked. However, I can't seem to find a way to get which lines of code threads were blocked on. Is there a way - either programatically or via JMC - to work out where the blocking is occuring?

Sina Madani
  • 1,246
  • 3
  • 15
  • 27

1 Answers1

1

You can see the different stack traces in the Hot Methods subtab on the Threads/Hot Threads tab, click a thread to see the stack traces only for that.

In JMC 6 you see the same info in the Lock Instances page, and the stack traces in the Stack Trace view.

Klara
  • 2,935
  • 22
  • 19
  • I can't seem to find the Lock Instances. I'm using JMC 6 – Sina Madani Nov 02 '17 at 11:01
  • It should be in the Outline view, as a child under the Java Application page – Klara Nov 03 '17 at 17:06
  • I must be really stupid, I just see "An outline is not available" under the outline view. – Sina Madani Nov 03 '17 at 21:54
  • "An outline is not available" is what you would see if you have no fligh recording (JFR file) opened. – Klara Nov 06 '17 at 08:25
  • Ah ok, so I need to use Flight Recorder? I was assuming that it can be done with JMX console only – Sina Madani Nov 06 '17 at 10:28
  • Even using flight recorder, I don't see how your answer is an answer to my question. The Lock Instances shows me nothing, at least when doing a 1 minute recording of the JVM running JMC. Hence, no upvote or accepted answer. – Sina Madani Nov 06 '17 at 22:55