I want to generate full thread dump output(like kill -3) inside JVM. First of all , is it possible (in 1.5 or older)?
Is there any code example? How JVM generate this output, when kill -3 is triggered? It uses jni? How can use it in a java class?
I can generate partial of this output like using
ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
long ids = mbean.findMonitorDeadlockedThreads();
and for stacetrace,
Map thrdMap = Thread.getAllStackTraces();
But output is not same.I want to use output to see in thread dump analyzers(it must be well-defined format). Thread.getAllStackTraces()doesnt contain - waiting to lock (a java.lang.Object).