Skip to content

Documentation for -XX:[+|-]EnableDynamicAgentLoading #1140

Closed
@JasonFengJ9

Description

@JasonFengJ9

Issue or pull request number:

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions