Description
Issue or pull request number:
- Add support for -XX:[+/-]EnableDynamicAgentLoading flag openj9#17215
- Implement JEP 451: Prepare to Disallow the Dynamic Loading of Agents openj9#17932
- JEP 451 skips the warning message if the agent library was loaded openj9#17990
Overview:
For Java 8 and later, the dynamic loading of JVM TI agents is enabled by default unless -XX:-EnableDynamicAgentLoading
is specified.
For Java 21 and later, the following warnings are issued when an agent is loaded dynamically into a running VM after startup without specifying the -XX:+EnableDynamicAgentLoading option and the same agent wasn't loaded before:
WARNING: A {Java,JVM TI} agent has been loaded dynamically (file:/u/bob/agent.jar)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a future release
For AIX
platform that can't detect if an agent library was previously loaded, the warnings will be issued when an agent is loaded dynamically through Attach API VirtualMachine.loadAgentLibrary(agent)
even if the agent was loaded via the command line -agentpath:/Absolute/Path/to/agentLibrary
at startup.
Release target:
Eclipse OpenJ9 0.41.0
Applies to the following JDK versions:
-XX:[+|-]EnableDynamicAgentLoading
- 8 and later
Issuing the warning message - 21 and later
Applies to the following platforms:
All platforms
For new command line options:
- Option name and syntax: e.g. -XX:[+|-]EnableDynamicAgentLoading