graal
graal copied to clipboard
Add support for ManagementFactory.getThreadMXBean().dumpAllThreads()
Right now, ManagementFactory.getThreadMXBean().dumpAllThreads() throws a com.oracle.svm.core.jdk.UnsupportedFeatureError. Would be great if it could really do a thread dump.
GraalVM: 22.1
Any chances of this getting implemented? It would help a lot with debugging performance problems.
Any chances of this getting implemented? It would help a lot with debugging performance problems.
If you are looking into time spend on CPU, I would suggest using perf on Linux. See https://www.graalvm.org/latest/reference-manual/native-image/debugging-and-diagnostics/DebugInfo/ .
NOTE: I did get better results with -H:+PreserveFramePointer instead of -g. When using FP, you would use perf record --call-graph=fp ..., which is actually the default. For -g, you would use perf record --call-graph=dwarf ....
Thanks for the advice, but my use case is somewhat different. I've developed a program for end users which I converted to Native Image. Previously when debugging performance issues I could have them just click a button which would log the stack trace in the log and they could send the log to me. Now asking them to run per inside a docker container is a bit more complex :-)
I guess as an alternative you could use Thread.getAllStackTraces() to write everything out to a file?
Didn't know that would work with graal, will try it out. Thanks!
Why would this work but not the other call? I wouldve thought it's basically the same.
On Mon, 19 Feb 2024, 16:33 SergejIsbrecht, @.***> wrote:
I guess as an alternative you could use Thread.getAllStackTraces() to write everything out to a file?
— Reply to this email directly, view it on GitHub https://github.com/oracle/graal/issues/4714#issuecomment-1952707537, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADNUA6OEI7XJI7T546UWQWLYUNWDLAVCNFSM53H27XMKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJVGI3TANZVGM3Q . You are receiving this because you commented.Message ID: @.***>
For Spring Actuator it's the same, it uses ManagementFactory.getThreadMXBean().dumpAllThreads(true, true) to dump all threads. As long as this is not supported it is unfortunately unable to provide the thread dump Actuator functionality.