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

Thread dumps should show actual class locks

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 6
    • Fix Version/s: 6
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b54
    • CPU:
      generic
    • OS:
      generic

      Description

      >>The new thread dump output looks great but I wonder if one little
      >>improvement is possible. When it puts out something like this:
      >>
      >> - locked <0xf495fbb8> (a java.lang.Class)
      >>
      >>is there no way to list the actual class?(e.g. in my case today it is
      >>mostly java.util.logging.Logger) If the program is doing a lot of static
      >>synchronization I'm left staring at and matching up hex numbers, a more
      >>tiresome exercise.
      >>
      public class Foo extends Thread {
        static Object o = new Foo();
        public static void main(String[] args) {
      try {
      synchronized(Foo.class) {
      Foo.class.wait();
      }
      } catch (InterruptedException e){
      System.exit(0);
      }
        }
      }

      Just run this, then kill -3 (On Solaris it's control-\) and you'll see
      something like:

      - waiting on <0xd0c042f8> (a java.lang.Class)

      And the RFE is asking to see "a Foo" instead of "a java.lang.Class".

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ksrini Kumar Srinivasan
                Reporter:
                psoper Pete Soper (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: