On 28.04.2013 15:28, Mark Thomas wrote: > On 28/04/2013 14:19, ma...@apache.org wrote: >> Author: markt >> Date: Sun Apr 28 13:19:48 2013 >> New Revision: 1476761 >> >> URL: http://svn.apache.org/r1476761 >> Log: >> Improve logging by naming the Servlet that hasn't stopped. > > I'm currently looking at the trunk unit test failures with buildbot. I'm > not at all sure what is going on. The logs suggest threads are getting > stuck for extended periods of time (minutes in some cases) but it always > seems to happen with the same tests. > > The delays are too long for GC but they could be swapping related as > buildbot is running on a VM. If that were the case I'd expect to see > more variation in the test failures though. > > At the moment I am looking at improving the logging which has the added > benefit of being useful to our users as well. > > What I really need is the ability to trigger a thread dump from within > the JVM. While there are ways of doing it, none of them are particularly > simple. I might look into this if the logging doesn't get me anywhere.
I uploaded a class that has a static getDump() method which returns a thread dump formatted very similar to the usual "kipp -QUIT" one: http://people.apache.org/~rjung/ThreadDump.java It retrieves the ThreadMXBean from the platform MBean server, gets the ThreadInfo for each thread and formats the data. HTH. I had to strip down some longer code I had and only did a very quick test but it seemed to work for me. It assumes Java 6 or newer. Regards, Rainer --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org