Class ThreadDump


  • public class ThreadDump
    extends Object
    A convenience class for getting a thread dump.
    • Constructor Detail

      • ThreadDump

        public ThreadDump​(ThreadMXBean threadMXBean)
    • Method Detail

      • dump

        public void dump​(OutputStream out)
        Dumps all of the threads' current information, including synchronization, to an output stream.
        Parameters:
        out - an output stream
      • dump

        public void dump​(boolean lockedMonitors,
                         boolean lockedSynchronizers,
                         OutputStream out)
        Dumps all of the threads' current information, optionally including synchronization, to an output stream. Having control over including synchronization info allows using this method (and its wrappers, i.e. ThreadDumpServlet) in environments where getting object monitor and/or ownable synchronizer usage is not supported. It can also speed things up. See ThreadMXBean.dumpAllThreads(boolean, boolean)
        Parameters:
        lockedMonitors - dump all locked monitors if true
        lockedSynchronizers - dump all locked ownable synchronizers if true
        out - an output stream