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.
For a complete list of Hub-specific configuration parameters, see Configuration Parameters.
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 |
---|---|
To change the value of a parameter on a persistent basis, you can either:
| |
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 Use this option to test changes to your environment before you apply them on a persistent basis. |
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
You can set properties and JVM options for your server with the configure
command. You can use this method for any type of Hub installation.
To update JVM options programmatically for a Docker image:
Use the following command to stop the Hub service:
docker exec <containerId> stopRun the
configure
command:docker run -it --rm \ -v <path to conf directory>:/opt/hub/conf \ jetbrains/hub:<version> \ configure \ -J<[+-]jvmOptions>docker run -it --rm ^ -v <path to conf directory>:/opt/hub/conf ^ jetbrains/hub:<version> ^ configure ^ -J<[+-]jvmOptions>Replace
-J<[+-]jvmOptions>
with the list of 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-Xmx1024mdocker run -it --rm ^ -v <path to conf directory>:/opt/hub/conf ^ jetbrains/hub:<version> ^ configure ^ -J-XX:+HeapDumpOnOutOfMemoryError ^ -J-Xmx1024m
Restart the Hub service:
docker start <containerId>
To update JVM options programmatically for a ZIP installation:
Open a command-line interface and enter the following command to stop the Hub service:
hub.sh stopChange 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.Enter the
hub.sh configure
command, followed by 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-Xmx1024mUse the following command to restart the Hub service:
hub.sh restart
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.
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 in a Docker container:
Stop Hub:
docker exec <containerId> stopOpen the hub.jvmoptions file.
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.Start the Hub service:
docker start <containerId>
To update JVM options manually for a ZIP installation:
Open a command-line interface and enter the following command to stop the Hub service:
hub.sh stopOpen the hub.jvmoptions file.
For a ZIP distribution, the file is located in the
<Hub installation directory>/conf
directory.Edit the JVM options directly in the file. To set the value for a pre-defined JVM option, remove the special characters that mark the corresponding line as a comment and change the property to the desired value.
Save and close the file.
Use the following command to restart the Hub service:
hub.sh restart
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 in a Docker image:
Use the following command to stop the Hub service:
docker exec <containerId> stopRun 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>docker run -it --rm ^ -v <path to conf directory>:/opt/hub/conf ^ jetbrains/hub:<version> ^ configure-next-start ^ <ad hoc JVM options>For the
<ad hoc JVM options>
, specify the list of JVM options that should be applied on the next start of Hub service. Specify the ad hoc JVM options 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-Xmx1024mdocker run -it --rm ^ -v <path to conf directory>:/opt/hub/conf ^ jetbrains/hub:<version> ^ configure-next-start ^ --J-XX:+HeapDumpOnOutOfMemoryError ^ --J-Xmx1024mRestart the Hub service:
docker start <containerId>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 in a ZIP installation:
In a command-line interface, enter the following command to stop the Hub service:
hub.sh stopChange 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.Enter the
hub.sh start
command, followed by 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-Xmx1024mThe 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.
Default JVM Options
The following JVM options are configured for your Hub instance by default.