This page applies to an earlier version of the AppDynamics App IQ Platform.
See the latest version of the documentation.
On this page:
AppDynamics provides a utility for modifying JVM options for the Controller. The modifyJvmOptions utility is used to modify the JVM options in the Controller's domain.xml file. Changes made with the utility are retained across Controller upgrades.
To run the utility, invoke the modifyJvmOptions from the /bin subdirectory of the Controller home directory:
- On Linux use modifyJvmOptions.sh
- On Windows, run modifyJvmOptions.bat in an elevated command prompt
Any change to a Java option requires a Controller application server restart to take effect.
You can edit Controller settings that are not JVM options by manually editing the domain.xml file or by using the GlassFish asadmin utility.
Command Format
modifyJvmOptions [add | delete ] (jvm-option-name=jvm-option-value) [@jvm-option-name=jvm-option-value* ]
Separate multiple JVM options using the @ sign.
On Microsoft Windows, you will need to enclose the entire JVM option names and values string in double quotation marks. The examples illustrate this requirement.
Description
The modifyJvmOptions utility adds or deletes command-line options that are passed to the Java application launcher when GlassFish Server is started. These are in addition to the options that are preset in the GlassFish Server.
Use modifyJvmOptions to add or delete the following types of options:
- Java system properties: These options are set using the -D option of the Java Application launcher
- Startup parameters for the Java application launcher: These options are set using the dash (-) character
The utility does not validate your settings, so make sure you use valid values. Invalid options can cause Controller startup to fail.
To add multiple options, either run the utility once for each option or use an @ character to separate the options. Use care when attempting to add multiple options at once. If you use a character separator other than @ character, it will result in a single key with the intended additional keys as part of the key value.
To update an existing value, use the modifyJvmOptions utility to add the option with the new value. If the setting already exists in the configuration, the utility removes the existing settings and adds the setting with your new value.
To delete a Java option, supply the full key name and value of the option. You cannot delete an option by key name only. For example:
modifyJvmOptions.sh delete -Dunixlocation=\root\example
To see a list of existing options in the domain configuration, use the list command, "modifyJvmOptions.sh list" or "modifyJvmOptions.bat list".
Restart
After you have finished adding or deleting options using modifyJvmOptions, stop and restart the GlassFish app server:
Linux
<controller_installation_directory>\bin\controller.sh stop-appserver <controller_installation_directory>\bin\controller.sh start-appserver
Windows
The following commands must be run in an elevated command prompt, which you can access by right-clicking on the Command Prompt icon in the Windows Start menu and choosing Run as administrator.
<controller_installation_directory>\bin\controller.bat stop-appserver <controller_installation_directory>\bin\controller.bat start-appserver
Examples
Modify a startup parameter for the Java Application Launcher
The following command sets the maximum available heap size to 1024MB using modifyJvmOptions.sh:
modifyJvmOptions.sh add "-Xmx1024m"
The following command deletes the maximum available heap size parameter set in the previous command:
modifyJvmOptions.sh delete "-Xmx1024m"
Modify Multiple Startup Parameters for the Java Application Launcher
The following command sets the maximum available heap size to 1024 and requests details about garbage collection using modifyJvmOptions.bat.
To run the command, open an elevated command prompt by right-clicking on the Command Prompt icon in the Windows Start menu and choosing Run as administrator.
modifyJvmOptions.bat add "-Xmx1024m@-XX\:+PrintGCDetails"
The following command deletes the startup parameters set in the previous command
modifyJvmOptions.bat delete "-Xmx1024m@-XX\:+PrintGCDetails"
Modify Multiple Java System Properties
The following commands add and delete multiple Java system properties using modifyJvmOptions.bat. Note that the quotation marks enclosing the argument string are required. The commands must be run in an elevated command prompt, which you can access by right-clicking on the Command Prompt icon in the Windows Start menu and choosing Run as administrator.
modifyJvmOptions.bat add "-Dunixlocation=/root/example@-Dvariable=\$HOME@-Dwindowslocation=d\:\\sun\\appserver@-Doption1=value1" modifyJvmOptions.bat delete "-Dunixlocation=/root/example@-Dvariable=\$HOME@-Dwindowslocation=d\:\\sun\\appserver@-Doption1=value1"
The following commands add and delete multiple Java system properties using modifyJvmOptions.sh. Quotation marks enclosing the argument string are not required.
modifyJvmOptions.sh add -Dunixlocation=/root/example@-Dvariable=\$HOME@-Dwindowslocation=d\:\\sun\\appserver@-Doption1=value1 modifyJvmOptions.sh delete -Dunixlocation=/root/example@-Dvariable=\$HOME@-Dwindowslocation=d\:\\sun\\appserver@-Doption1=value1