Skip to content

[GR-38579] Add support for ManagementFactory.getThreadMXBean().dumpAllThreads() #4714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mhalbritter opened this issue Jul 11, 2022 · 6 comments
Assignees
Labels

Comments

@mhalbritter
Copy link

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

@theotherp
Copy link

Any chances of this getting implemented? It would help a lot with debugging performance problems.

@SergejIsbrecht
Copy link

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 ....

@theotherp
Copy link

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 :-)

@SergejIsbrecht
Copy link

I guess as an alternative you could use Thread.getAllStackTraces() to write everything out to a file?

@theotherp
Copy link

theotherp commented Feb 19, 2024 via email

@cmdjulian
Copy link

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.

@wirthi wirthi changed the title Add support for ManagementFactory.getThreadMXBean().dumpAllThreads() [GR-38579] Add support for ManagementFactory.getThreadMXBean().dumpAllThreads() Nov 6, 2024
@wirthi wirthi assigned wirthi and unassigned christianwimmer Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants