Is it possible to get a thread dump of a Java Web Start application? And if so, how?
It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dump programmatically?
In the Java Web Start Console I can get a list of threads by pressing ‘t’ but stacktraces are not included.
If answers require certain java versions, please say so.
In the console, press V rather than T:
This works under JDK6. Don’t know about others.
Alternative, under JDK5 (and possibly earlier) you can send a full stack trace of all threads to standard out:
Under Windows: type ctrl-break in the Java console.
Under Unix:
kill -3 <java_process_id>(e.g. kill -3 5555). This will NOT kill your app.One other thing: As others say, you can get the stacks programatically via the
Threadclass but watch out forThread.getAllStackTraces()prior to JDK6 as there’s a memory leak.https://bugs.java.com/bugdatabase/view_bug?bug_id=6434648
Regards,
scotty