PingDirectory

Changing the JVM garbage collector type

You can change the JVM garbage collector type by using a CLI tool or by editing the Java properties file manually.

The PingDirectory server uses the G1 garbage collector by default.

Before you begin

Before attempting to change the JVM garbage collector type:

  • Consult Ping Identity Support.

  • Confirm that your environment meets the JDK version requirements for your targeted garbage collection type.

If you proceed, ensure that you have a backup copy of your java.properties file in the config directory. The backup file usually has the same file name with a .old extension. If you don’t have a backup, do one of the following:

  • Run bin/dsjavaproperties --initialize.

    Each time you run this command, the server overwrites the java.properties.old file if it exists. It can also overwrite any changes you made to java.properties after installing the server.
  • Copy the file to a safe directory manually.

The server supports the following garbage collection types:

Name Encoded name Supported JDK version(s)

G1 (default)

g1

17, 21

ZGC

zgc

17, 21

Generational ZGC

generational-zgc

21

Steps

  • Change the garbage collector type by doing one of the following.

    These choices involve running $ bin/dsjavaproperties --initialize, which can overwrite any changes you made to java.properties after installing the server.

    Choose from:

    • When making changes to multiple servers, use the dsjavaproperties tool.

      • Run the following command, substituting the encoded name of the garbage collector from the previous table:

        $ bin/dsjavaproperties --gcType <encoded_gc_name> --initialize
    • When making changes to one server, edit the java.properties file manually.

      • Change the value of the gc-type parameter to the encoded name of the garbage collector from the previous table.

      • Save the java.properties file.

      • Run $ bin/dsjavaproperties --initialize.

  • Restart the server.

Troubleshooting

If something goes wrong and you need to restore your java.properties file to the backup version, do the following:

  1. Add a .bad extension to the malfunctioning java.properties file.

  2. Change the name of the working backup file to java.properties and, if needed, place it in the config directory.

  3. Run $ bin/dsjavaproperties with no arguments.

  4. Restart the server.