-
Notifications
You must be signed in to change notification settings - Fork 147
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
Add -XX:+EnableDynamicAgentLoading for JEP 451 #25268
base: 8.0
Are you sure you want to change the base?
Conversation
…EP 451 Signed-off-by: dmiya3 <[email protected]>
I was thinking why the PR doesn't lead to master, now I know ... the JEP 451 is for Java 21, so the option would not exist in 11-17.
|
My view:
|
@OndroMih The JVMOptions class processes values from domain.xml; The Java version can be retrieved from the |
Getting the version from Runtime.version() would not be correct. It would be the version of Java used to run the asadmin command, which might be different from the version used to run the server. Remember that it’s possible to specify path the the JVM in domain.xml. In that case, the logic should check the version of Java specified in domain.xml. If it’s not set, then yes, it could just use Runtime.version(), assuming that the server is started with the same JDK. |
Adding this JVM option to GlassFish also hides warnings intended for the user application, so I'm hesitant to merge this change... Is it not straightforward to modify the monitor func(?) to avoid using DynamicAgentLoading? |
You are right, then the only option is to execute the Another option is Hiroki's idea - does Flashlight really need the dynamic loading? Maybe then it stops being "flash", I don't know. Didn't Adam Bien use it years ago? I have no experience with this feature. |
I think we can include flashlight agent directly on the command line immeiately, and not load it lazily at runtime. The only thing that the agent does is it stores the Instrumentation context, it seems. The context is then used by reflection if the agent is loaded. So loading the agent everytime at startup is almost no overhead. |
Currently, starting GlassFish on JDK 21 and then executing
asadmin enable-monitoring
prints the following message in the server log:Signed-off-by: dmiya3 [email protected]