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.
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.
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:
To see a list of existing options in the domain configuration, use the list command, "modifyJvmOptions.sh list" or "modifyJvmOptions.bat list".
After you have finished adding or deleting options using modifyJvmOptions, stop and restart the GlassFish app server:
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.
Modify a startup parameter for the Java Application Launcher
The following command sets the maximum available heap size to 1024MB using modifyJvmOptions.sh:
The following command deletes the maximum available heap size parameter set in the previous command:
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.
The following command deletes the startup parameters set in the previous command
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.
The following commands add and delete multiple Java system properties using modifyJvmOptions.sh. Quotation marks enclosing the argument string are not required.