Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-5163

Add JDK 6 version of ServerInfo.listThreadDump() taking advantage of new management classes

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Major
    • JBossAS-5.0.0.CR1
    • JBossAS-4.2.2.GA, JBossAS-5.0.0.Beta3
    • Web Console
    • None
    • Medium
    • 0
    • 0% 0%

    Description

      There're 4 ways to generate a thread dump. I have taken the output from the same run with
      different methods:

      1.- kill -3. Can be parsed by tools like https://tda.dev.java.net/ (simply, one of the most useful
      tools I've found out there!). Example:

      "JBossLifeThread" prio=1 tid=0x0a690cc0 nid=0x1741 in Object.wait() [0x867f2000..0x867f30b0]
      at java.lang.Object.wait(Native Method)

      • waiting on <0x9247e200> (a java.lang.Object)
        at java.lang.Object.wait(Object.java:474)
        at org.jboss.system.server.ServerImpl$LifeThread.run(ServerImpl.java:940)
      • locked <0x9247e200> (a java.lang.Object)

      2.- JMX via org.jboss.system.server.ServerInfo.listThreadDump(). Here's some output:

      Thread: JBossLifeThread : priority:5, demon:false, threadId:58, threadState:WAITING, lockName:java.l
      ang.Object@10cff6b

      java.lang.Object.wait(Native Method)
      java.lang.Object.wait(Object.java:474)
      org.jboss.system.server.ServerImpl$LifeThread.run(ServerImpl.java:940)

      Lock name is different to lock monitor achieved via kill -3. Doesn't looks like it prints previously locked
      monitors. Cannot be parsed by TDA tools because it's in JBoss specific format.

      3.- Thread.getAllStackTraces().

      Haven't tested the output from this. What would this print? Couldn't find an MBean that uses/parses
      the output from this, but I suspect it's the same as method 2, specially since
      http://jira.jboss.com/jira/browse/JBAS-1448 has already been fixed.

      4.- JConsole Threads view:

      Code:

      Name: JBossLifeThread
      State: WAITING on java.lang.Object@10cff6b
      Total blocked: 0 Total waited: 1

      Stack trace:
      java.lang.Object.wait(Native Method)
      java.lang.Object.wait(Object.java:474)
      org.jboss.system.server.ServerImpl$LifeThread.run(ServerImpl.java:940)

      Seems to print same info as JBoss' ServerInfo.

      Bottom line: we should try generating thread dumps that look like kill -3
      output to make them more readable than in their current format and to
      benefit from existing tools that can parse standard kill -3 format.

      Attachments

        1. jdk5-with-deadlock.pdf
          51 kB
        2. jdk5-with-deadlock-v2.pdf
          51 kB
        3. jdk5-without-deadlock.pdf
          54 kB
        4. jdk5-without-deadlock-v2.pdf
          55 kB
        5. jdk6-with-deadlocks.pdf
          54 kB
        6. jdk6-with-deadlocks-v2.pdf
          54 kB
        7. jdk6-without-deadlocks.pdf
          51 kB
        8. jdk6-without-deadlocks-v2.pdf
          58 kB
        9. jmx-serverinfo.dump
          29 kB
        10. kill-3.dump
          27 kB
        11. thread-deadlock.zip
          13 kB

        Issue Links

          Activity

            People

              rh-ee-galder Galder Zamarreño
              rh-ee-galder Galder Zamarreño
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: