-
Enhancement
-
Resolution: Duplicate
-
P2
-
None
-
1.3.0, 1.3.1, 1.4.0
-
generic, x86, sparc
-
generic, solaris_8, windows_nt, windows_2000
Name: krC82822 Date: 10/01/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
It would be extremely useful to be able to obtain a full thread dump
programmatically, e.g. by adding a method to java.lang.Runtime to return what
otherwise can only be obtained by a Ctrl-C (SIGINT) in the console window.
If the production version of our application hangs, we have no way of sending
it an interrupt to obtain the thread dump. But we can add code to the
application to get the dump on demand (say from a troubleshooting menu).
For ease of parsing, it would be most convenient if:
(a) each thread's stack backtrace was returned separately, either as a String
or a custom class object;
(b) each monitor in the monitor cache dump was returned separately, either as a
String or custom class object.
Looking at the JVM code, I can see that the String return values would be
easier. Returning an array of Strings would be sufficient.
Alternatively, perhaps an OutputStream could be supplied to the method and the
thread dump written to the stream.
(Review ID: 109991)
======================================================================
- duplicates
-
JDK-4615612 Ability to generate thread dump from Java land
-
- Closed
-
-
JDK-4593133 API to generate Java stack traces for all threads
-
- Resolved
-
- relates to
-
JDK-4074976 Can't get Stack Trace into string easily; the only option is to print it.
-
- Closed
-
-
JDK-4098246 custom backtraces
-
- Closed
-