AppDynamics Application Intelligence Platform

3.8.x Documentation

PDFs

Videos

Release Notes

AppDynamics provides a utility for modifying JVM options for the Controller. These options appear within the jvm-options elements in the Controller's domain.xml file.

The modifyJvmOptions utility lets you modify these settings in a way that AppDynamics can track, and therefore retain across Controller upgrades. Using modifyJvmOptions also ensures that the modifications are inserted in the correct place in the domain.xml file.

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

If adding more than one Java option at a time, use an @ character to separate the options. If you need to update an existing option, use the modifyJvmOptions utility to delete the existing option first, then add the same option with the new value. 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.

Synopsis

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 it is necessary to enclose the entire JVM option names and values string in double-quotation marks. This is a Microsoft Windows requirement. See the examples.

New in 3.8.4 For Linux, the utility has an additional option, list. Entering the following command returns the list of options in the configuration file:

 modifyJvmOptions.sh list

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 startup to fail. After the server starts, the options are written to server.log before any other information is logged.

New in 3.8.4 The Linux version of the utility prevents you from adding a key with the same name as an existing key in the configuration file. To update an existing option, you need to delete it and then add it with the new value. To view the existing settings in the configuration, use the list option with the command. 

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

Learn More