forked from eclipse-openj9/openj9-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation for -XX:[+|-]EnableDynamicAgentLoading
eclipse-openj9#1140 Created a new topic for the -XX:[+|-]EnableDynamicAgentLoading option Updated the related topics. Closes eclipse-openj9#1140 Signed-off-by: Sreekala Gopakumar <sreekala.gopakumar@ibm.com>
- Loading branch information
1 parent
0a66e30
commit 5824eb1
Showing
4 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<!-- | ||
* Copyright (c) 2017, 2023 IBM Corp. and others | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ or the Apache | ||
* License, Version 2.0 which accompanies this distribution and | ||
* is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* This Source Code may also be made available under the | ||
* following Secondary Licenses when the conditions for such | ||
* availability set forth in the Eclipse Public License, v. 2.0 | ||
* are satisfied: GNU General Public License, version 2 with | ||
* the GNU Classpath Exception [1] and GNU General Public | ||
* License, version 2 with the OpenJDK Assembly Exception [2]. | ||
* | ||
* [1] https://www.gnu.org/software/classpath/license.html | ||
* [2] https://openjdk.org/legal/assembly-exception.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 | ||
--> | ||
|
||
# -XX:\[+|-\]EnableDynamicAgentLoading | ||
|
||
This option enables or disables the dynamic loading of agents into a running VM. | ||
|
||
|
||
## Syntax | ||
|
||
-XX:[+|-]EnableDynamicAgentLoading | ||
|
||
| Setting | Effect | Default | | ||
|-----------------------|---------|:----------------------------------------------------------------------------------:| | ||
| `-XX:+EnableDynamicAgentLoading` | Enable | :fontawesome-solid-check:{: .yes aria-hidden="true"}<span class="sr-only">yes</span> | | ||
| `-XX:-EnableDynamicAgentLoading` | Disable | | | ||
|
||
|
||
## Explanation | ||
|
||
With the [Attach API](attachapi.md), your application can connect to a running VM and load an agent dynamically into that VM to run tasks. Some libraries misuse the Attach API to dynamically load an agent to run tasks without the approval of the application owner. | ||
|
||
You can disable the dynamic loading of the agents into a VM after startup with the `-XX:-EnableDynamicAgentLoading` option. | ||
|
||
![Start of content that applies to Java 21 (LTS) and later](cr/java21plus.png) For Java™ 21 and later, the following warnings are issued when the agents are loaded dynamically into a running VM after startup without specifying the `-XX:+EnableDynamicAgentLoading` option and the same agents were not loaded at startup by using the [command-line options](interface_jvmti.md#overview): | ||
|
||
``` | ||
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 | ||
``` | ||
AIX® systems cannot detect whether an agent library was previously loaded at startup or not. Therefore, the warnings are issued when an agent is loaded dynamically through the Attach API (`VirtualMachine.loadAgentLibrary(agent)`) even if the agent was loaded through the command-line option (`-agentpath:/Absolute/Path/to/agentLibrary`) at startup. ![End of content that applies to Java 21 (LTS) and later](cr/java_close_lts.png) | ||
|
||
## See also | ||
|
||
- [Java Virtual Machine Tool Interface](interface_jvmti.md) | ||
- [Java Attach API](attachapi.md) | ||
|
||
<!-- ==== END OF TOPIC ==== xxenabledynamicagentloading.md ==== --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters