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.
JVM options that differ from the default configuration are stored 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. |
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.
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.
Use the following command to stop the Hub service:
docker exec <containerId> stop
Run the
configure
command:note
When you execute the
configure
command, make sure to keep the local system path to theconf
directory in volume mappings the same as the mapping specified in the run command for the main server. Otherwise, updates are not applied to the Hub configuration files.note
To make sure you see information that is relevant to your installation, select the tab that corresponds with the operating system used in your host environment.
LinuxWindowsdocker 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:
LinuxWindowsdocker run -it --rm \ -v <path to conf directory>:/opt/hub/conf \ jetbrains/hub:<version> \ configure \ -J-XX:+HeapDumpOnOutOfMemoryError \ -J-Xmx1024m
docker 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>
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.
note
Changing Database LocationYou cannot change the database location manually. This parameter is rewritten on server start. For details, see Change Database Location.
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.
Stop Hub:
docker exec <containerId> stop
Open 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>
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.
Use the following command to stop the Hub service:
docker exec <containerId> stop
note
To make sure you see information that is relevant to your installation, select the tab that corresponds with the operating system used in your host environment.
Run the
configure-next-start
command:LinuxWindowsdocker 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:
LinuxWindowsdocker run -it --rm \ -v <path to conf directory>:/opt/hub/conf \ jetbrains/hub:<version> \ configure-next-start \ --J-XX:+HeapDumpOnOutOfMemoryError \ --J-Xmx1024m
docker run -it --rm ^ -v <path to conf directory>:/opt/hub/conf ^ jetbrains/hub:<version> ^ configure-next-start ^ --J-XX:+HeapDumpOnOutOfMemoryError ^ --J-Xmx1024m
Restart the Hub service:
docker start <containerId>
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.
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
Thanks for your feedback!