From 181911376ce7ef1276378188169245f6bba4506d Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Tue, 2 Dec 2014 16:21:06 +0100 Subject: [PATCH] showing list of all thread in threaddump using the ThreadMXBean counter (this obviously show more threads than before?) --- htroot/Threaddump_p.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htroot/Threaddump_p.java b/htroot/Threaddump_p.java index fd942609b..32bd879f0 100644 --- a/htroot/Threaddump_p.java +++ b/htroot/Threaddump_p.java @@ -28,6 +28,9 @@ import java.io.File; import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.lang.management.ThreadInfo; +import java.lang.management.ThreadMXBean; import java.util.ArrayList; import java.util.Date; import java.util.Map; @@ -106,6 +109,15 @@ public class Threaddump_p { ThreadDump.bufferappend(buffer, plain, "************* End Thread Dump " + dt + " *******************"); + + ThreadDump.bufferappend(buffer, plain, ""); + ThreadMXBean threadbean = ManagementFactory.getThreadMXBean(); + ThreadDump.bufferappend(buffer, plain, "Thread list from ThreadMXBean, " + threadbean.getThreadCount() + " threads:"); + ThreadInfo[] threadinfo = threadbean.dumpAllThreads(true, true); + for (ThreadInfo ti: threadinfo) { + ThreadDump.bufferappend(buffer, plain, ti.getThreadName()); + } + prop.put("plain_count", multipleCount); prop.put("plain_content", buffer.toString()); prop.put("plain", (plain) ? 1 : 0);