Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8143176

Show how long a thread has been waiting for a lock in thread dumps

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: hotspot

      Description

      In thread dumps it is very hard to see if a thread is stuck waiting for a lock or not. Even if you take several thread dumps and one thread has the same stack trace between runs, it is hard to see if it is stuck or if it has executed and then returned to the same stack trace.

      One great feature would be if we could print how long a thread has waited for a lock in thread dumps. To do this, we would of course have to take a time stamp when we start waiting for a contended lock, but we already do this if JFR is turned on.

      Then, when we print a thread dump, for bugs waiting on locks we could also print "has been waiting for 10000ms". This would be a very handy output to show if a thread is stuck or not.


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mcastegr Mattis Castegren (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: