Hub 2.5 Help

Set System Properties and JVM Options

On this page:

You can configure the system properties and JVM options for your Hub instance.

  • Many system properties correspond to system settings that can be set in the user interface. For a complete list of Hub-specific system properties, see Configure System Properties.
  • The JVM options let you manage behavioral, garbage collection, performance, and debugging options for your server. These settings are not visible in the user interface.

You can set the system properties for Hub with commands that are interpreted by script files. These script files are included in your Hub installation. There are two commands that you can use to update your Hub installation.

CommandDescription
startStarts the Hub server. System properties and JVM options that are added as ad hoc parameters to the start command are applied directly to the Hub database. For details, see Set an Ad Hoc Parameter.
configureUpdates the Hub configuration. System properties and JVM options that are referenced in the configure command are added to the hub.jvmoptions configuration file. For details, see Update the Configuration File.

These commands are available for both MSI and ZIP installations. To execute these commands in an MSI distribution, open the Command Prompt window as an administrator.

Always execute commands on behalf of the OS user that runs the Hub service. These commands create configuration files and folders. The Hub service user should have sufficient permissions to access these files and folders.

Configuration Guidelines

Hub stores system properties in and JVM options in an internal configuration file. Every time you start the Hub service, Hub reads this file and applies this configuration to the Hub database.

The one-way synchronization from the configuration file to the database can lead to problems if you're not careful. System properties that are set in the Hub user interface are applied directly to the Hub database. If you change a setting in the user interface that has been updated in the configuration file, the setting in the configuration file is applied to the database on restart, overwriting the setting in the UI.

To avoid conflicts, follow these guidelines:

  • If the system property is available in the user interface, update and manage these settings in the user interface. This ensures that you don't have synchronization issues with the configuration file.

    If you choose to modify any of these system properties programmatically, pass them as ad hoc parameters with the start command. This method updates the settings in the database without applying changes to the configuration file.

  • If the setting is not managed in the user interface, you have two options:
    • To change a setting on a temporary basis, pass the setting as an ad hoc parameter with the start start command. This method updates the database for the current run and does not change the configuration file. Use this option when you want to test changes to your server configuration.
    • To change a setting on a persistent basis, update the configuration file. You can use the configure command or edit the configuration file manually.

Syntax

Use the following syntax to update system settings:

  • Declare an option that is passed to the Java virtual machine with the -J prefix. You can set multiple options in a single command. For example:
    hub configure -J-Xmx1024m -J-XX:+HeapDumpOnOutOfMemoryError
  • Pass the setting as an ad hoc parameter in the start command with the --J prefix. For example:
    hub start --J-Xmx1024m --J-XX:+HeapDumpOnOutOfMemoryError
  • Follow the prefix with a system property or 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.
    • Remove an option with the + symbol. If you specify a value, the corresponding option is only removed if it has exactly the same value.
  • Set system properties with D arguments. For example:
    hub start --J-Djetbrains.jetpass.smtp.from=no-reply@test.com

Set an Ad Hoc Parameter

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

To change a setting on a temporary basis:

  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>/bin directory is the location where the ZIP distribution was unpacked during installation.
    • For an MSI installation, the <hub_home>/bin directory is %programdata%\JetBrains\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. For example:
    hub.sh start --J-XX:+HeapDumpOnOutOfMemoryError --J-Djetbrains.jetpass.smtp.from=no-reply@test.com
    • The Hub service starts using the specified settings.
    • The hub.jvmoptions configuration file is not modified.

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

Update the Configuration File

When you want to update a setting on a persistent basis, update the configuration file. You can update the file programmatically, or manually change the settings in the file.

To configure system properties and JVM options programmatically:

  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>/bin directory is the location where the ZIP distribution was unpacked during installation.
    • For an MSI installation, the <hub_home>/bin directory is %programdata%\JetBrains\Hub.
  3. Enter the hub.sh configure command, followed by all of the settings that you want to update in the configuration file. For example:
    hub.sh configure -J-XX:+HeapDumpOnOutOfMemoryError -J-Djetbrains.jetpass.smtp.from=no-reply@test.com
  4. Start the Hub service.

If you prefer not to modify the configuration 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.

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 system properties and JVM options.

To configure system properties or JVM options manually:

  1. Stop the Hub service.
  2. Open the hub.jvmoptions file.
  3. Edit the JVM options directly in the file. To set a pre-defined JVM option, simply uncomment the corresponding line.
    • List each JVM option on a new line.
    • Add system properties to the end of the file.
  4. Save and close the file.
  5. Start the Hub service.
    • The changes to the configuration file are copied to the Hub database.
    • The Hub service starts using the specified settings.
Last modified: 20 September 2016