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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 10
    • 9
    • hotspot

      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.


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

              Created:
              Updated:
              Resolved: