I have an multi-threaded application that runs for 1m9s (with 56 concurrent threads). The JFR screenshot of the contentions is show below. What is not clear to me are:
- What does the Count field indicate? The number of times the Lock has been acquired?
- What does the Average value indicate? And how is it that the Duration (= count * average) greater than the total execution time of the application?
Thanks,
If I remember correctly the tab you're looking at there shows the number of times a thread has been blocked waiting on each lock grouped by the class (i.e. it counts multiple instances of the lock as the same here). The reason you might see a cumulative duration longer than the total runtime of the application is that it counts the wait time of each thread. Since you have 56 threads running (assuming that they run for the entire runtime of the application) the maximum amount of time that can be spent blocking on one particular lock is around 64 minutes (69s*56).