Hub 2019.1 Help

Configure JVM Options

You can configure the JVM options for your Hub instance. These options let you manage behavioral, garbage collection, performance, and debugging options for your server. These parameters cannot be updated in the Hub user interface.

Hub stores JVM options in an internal file named hub.jvmoptions. Every time you start the Hub service, Hub reads this file and applies the parameters that are stored in this configuration to the Hub instance.

There are two methods that you can use to update these parameters:

Method

Description

Update the parameter temporarily.

You can pass the JVM option on a temporary basis as an ad hoc start parameter. The value for the parameter is set for the current run only. The hub.jvmoptions file is not updated, so when you restart your Hub instance without the start parameter, the parameter resets to the value that is stored in the configuration. Use this option to test changes to your environment before you apply them on a persistent basis.

Update the parameter on a persistent basis.

To change the value of a parameter on a persistent basis, you can update the JVM option in the hub.jvmoptions file.

Update Parameters Temporarily

When you want to modify a JVM option on a temporary basis, you can use an ad hoc parameter in the service start command. This method bypasses the hub.jvmoptions file and runs Hub with the specified parameters. Subsequent starts that do not specify the ad hoc parameter use the JVM options that are stored in the configuration file.

To pass a JVM option as an ad hoc parameter:

  1. Stop the Hub service.

  2. In a command-line interface, change the directory to <hub_home>/bin.

    • For a ZIP installation, the <hub_home> directory is the location where the ZIP distribution was unpacked during installation.

    • For an MSI installation, the <hub_home> directory is the location where the MSI distribution was installed. The default installation directory is C:\Hub

  3. Enter the hub.sh startcommand, followed by all of the settings that you want to pass to the Hub database on start.

    • Use the --J prefix to pass the settings as ad hoc parameters.

    • Follow the prefix with a JVM option. Do not add any spaces between the prefix and the option. The symbol that precedes the option determines how it is applied.

      • Add an option with the - symbol.

      • Ignore an option with the + symbol. If you specify a value, the corresponding option is only ignored if it has exactly the same value.

    For example:

    hub.sh start --J-XX:+HeapDumpOnOutOfMemoryError --J-Xmx1024m
    • The Hub service starts using the specified settings.

    • The hub.jvmoptions file is not modified.

To pass a JVM option as an ad hoc parameter to Docker image:

  1. Stop Hub docker container.

  2. Run the configure-next-start command:

    docker run -it --rm \ -v <path to conf directory>:/opt/hub/conf jetbrains/hub:<version> \ configure-next-start \ <ad hoc JVM options>

    <ad hoc parameters> — a list of all JVM options that should be applied on the next start of Hub service. Ad hoc JVM options should be provided in the following format:

    --J<JVM option>

    --J is the ad hoc prefix followed by the option. Do not add any spaces between the prefix and the option. The symbol that precedes the option determines how it is applied.

    • Add an option with the - symbol.

    • Ignore an option with the + symbol. If you specify a value, the corresponding option is only ignored if it has exactly the same value.

    For example:

    docker run -it --rm \ -v <path to conf directory>:/opt/hub/conf jetbrains/hub:<version> \ configure-next-start \ --J-XX:+HeapDumpOnOutOfMemoryError \ --J-Xmx1024m
  3. Start the docker container.
    • The Hub service starts using the specified settings.

    • The hub.jvmoptions file is not modified.

To run Hub with the previous settings, restart the service without passing any custom parameters.

Update Parameters on a Persistent Basis

When you want to update a JVM option on a persistent basis, update the hub.jvmoptions file. You can update the file programmatically, or manually change the settings in the file.

Update JVM Options with a Command

To update JVM options programmatically for ZIP or MSI distribution:

  1. Stop the Hub service.

  2. In a command-line interface, change the directory to <hub_home>/bin.

    • For a ZIP installation, the <hub_home> directory is the location where the ZIP distribution was unpacked during installation.

    • For an MSI installation, the <hub_home> directory is the location where the MSI distribution was installed. The default installation directory is C:\Hub

  3. Enter the hub.sh configure command, followed by all of the JVM options that you want to update in the configuration file. The symbol that precedes the option determines how it is applied.

    • Add an option to the configuration file with the - symbol.

    • Remove an option from the configuration file with the + symbol. If you specify a value, the corresponding option is only removed if it has exactly the same value.

    For example:

    hub.sh configure -J-XX:+HeapDumpOnOutOfMemoryError -J-Xmx1024m
  4. Start the Hub service.

To update JVM options programmatically for a Docker image:

  1. Stop Hub docker container.

  2. Run the configure command:

    docker run -it --rm \ -v <path to conf directory>:/opt/hub/conf jetbrains/hub:<version> \ configure \ -J<[+-]jvmOptions>

    -J<[+-]jvmOptions> — is a list of all of the JVM options that you want to update in the configuration file. The symbol that precedes the option determines how it is applied.

    • Add an option to the configuration file with the - symbol.

    • Remove an option from the configuration file with the + symbol. If you specify a value, the corresponding option is only removed if it has exactly the same value.

    For example:

    docker run -it --rm \ -v <path to conf directory>:/opt/hub/conf jetbrains/hub:<version> \ configure \ -J-XX:+HeapDumpOnOutOfMemoryError \ -J-Xmx1024m
  3. Start Hub docker container.

Modify JVM Options Manually

If you prefer not to modify the file from the command line, you can edit the hub.jvmoptions file manually. This file is created automatically when you modify the default configuration. The location of the file depends on the distribution type of your Hub installation.

  • For a ZIP distribution, the file is located in the <Hub Installation Directory>\conf directory.

  • For an MSI distribution the file is located in the %programdata%\JetBrains\Hub\conf directory.

  • For a Docker image, the file is located in the conf directory on the host machine that is mapped to the /opt/hub/conf directory inside the container.

If you have not changed the JVM options for your server, the directory contains a sample configuration file. The sample configuration file uses the .dist extension and contains a list of default JVM options. If the file you want to edit does not exist:

  • Copy the hub.jvmoptions.dist file and save it as hub.jvmoptions
    or

  • Create a hub.jvmoptions file in this directory and paste the contents of the sample configuration file into it.

You can then edit the contents of the file to configure the JVM options.

To update JVM options manually:

  1. Stop the Hub service.

  2. Open the hub.jvmoptions file.

  3. Edit the JVM options directly in the file.

    • To change the value of a pre-defined JVM option, uncomment the corresponding line and update the value of the parameter.

    • List each JVM option on a new line.

  4. Save and close the file.

  5. Start the Hub service.

    • The changes to the configuration file are applied to the environment.

    • The Hub service starts using the specified JVM options.

Default JVM Options

The following JVM options are configured for your Hub instance by default.

-ea -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%APP_LOGS_DIR% -XX:ErrorFile=%APP_LOGS_DIR%%FILE_SEPARATOR%hs_err_pid%%p.log -Dfile.encoding=UTF-8 *Djava.awt.headless=true -XX:MaxPermSize=150m -XX:MaxMetaspaceSize=150m -Xmx600m -Dorg.eclipse.jetty.server.Request.maxFormContentSize=5000000 -Dorg.eclipse.jetty.server.Request.maxFormKeys=10000
Last modified: 17 February 2020