Thread dump programmatically /JDI (Java Debugger Interface)

前端 未结 4 1558
野的像风
野的像风 2020-12-05 21:41

I like to generate a thread dump programmatically. I\'ve learned that there a basically two ways to do it:

  1. Use the \"Java Virtual Machine Tool Interface\" JVM-
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 21:54

    There is a third way: Thread.getAllStackTraces()

    http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#getAllStackTraces()

    This is much easier than the debugger interface...

提交回复
热议问题