Java Thread Dump dumpThreads()

Here you can find the source of dumpThreads()

Description

dump Threads

License

Apache License

Declaration

public static void dumpThreads() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void dumpThreads() {

        ThreadGroup group = Thread.currentThread().getThreadGroup();
        int activeCount = group.activeCount();
        Thread[] threads = new Thread[activeCount];
        group.enumerate(threads);//from   www  . j  ava 2s .  c  o  m

        System.out.println("Thread-Group " + group + " contains " + activeCount + " threads");

        for (Thread thread : threads) {
            System.out.println("Thread " + thread);
        }
    }
}

Related

  1. dumpStack(Thread t)
  2. dumpThreadGroup(ThreadGroup tg, StringBuffer sb)
  3. dumpThreads()