-
Notifications
You must be signed in to change notification settings - Fork 740
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
MXBean to dynamically configure JVM Diagnostic Options #153
Comments
given that the dump options can be hard to compose into a command line would it make more sense to expose an API that helps you build the dump option you want and have that generate and set the JVM option so that the interface is more user friendly? Not sure if that would make the builder become stale too quickly, but making it easier to build the options string would seem to be a nice usability feature since the syntax is pretty complicated. Thoughts? |
+1 for that. If some wants to use this API, he shouldn't have to go through the user guide to understand the syntax to be able to pass correct option. |
Thought of having a mapping for few frequently used options, for example, JavaDumpOnThread would have a mapping internally to its equivalent -Xdump option. But having it generated for all cases would be useful. |
I have written a javascript tool for building Xdump options (internal IBM link). I hope to do the same for Xtrace when I have time, although I think Xtrace would be significantly more complicated. Maybe we could integrate something like this into the OpenJ9 documentation? |
@paulcheeseman By all means, please open a Pull Request on http://github.com/eclipse/openj9-website to contribute this. I'm sure the docs team will help integrate it into the website. |
I've opened an issue against the openj9-website repo. |
Sorry, copy/pasted the wrong link by accident, the correct website link is http://github.com/eclipse/openj9-website (corrected in previous comment as well). |
Tested with a liberty application running in a docker container on a remote host and was able to trigger dumps using jconsole to a shared volume. |
Below are few observations and queries:
After investigation, I found -Xdump:dynamic has to be specified if throw/catch events are configured through Dump.setDumpOptions() when JIT is ON, whereas this option is not required when we set the above option on command line using -Xdump. Shouldn't this be documented in Dump API or somewhere else? I could not find any documentation on this.
"methods=java/lang/String.*,print=mt"
|
Problem determination becomes difficult when there is no diagnostic information. A running OpenJ9 JVM includes mechanisms for producing different types of diagnostic data when different events occur. In general, the production of this data happens by default and can also be controlled by using the command line JVM options such as -Xdump or -Xtrace at JVM startup or by dynamically setting them using the com.ibm.jvm.Dump or com.ibm.jvm.Trace API
Instead of using these APIs, we can include a MXBean (which in turn calls the methods of Dump/Trace API) to dynamically configure these JVM options while remotely monitoring an application running in a remote server or container. This MXBean can be used in jconsole (or by any other monitoring tool / admin console) to dynamically configure the diagnostic options while monitoring the application, without having to actually restart the application.
We can include the following methods in the MXBean:
We can also extend the functionality to include few most commonly used options for capturing diagnostic information, for example,
Above option is just an example, we need to find if there are any such frequently used options.
Usage
Opening this issue to discuss on this requirement, please feel free to comment.
The text was updated successfully, but these errors were encountered: