Configure JVM Options
You can configure the properties and JVM options for your YouTrack instance. The YouTrack properties include various launch configuration settings. The JVM options let you manage behavioral, garbage collection, performance, and debugging options for your server.
The most common use case for editing the default JVM options for your YouTrack Server installation is when you perform an operation that places a heavy load on the server. This can include importing content from an external source or running bulk updates on a large number of issues. If you initiate a process that fails due to server timeouts or memory limits, you can temporarily increase the Java heap or Metaspace memory until the operation is complete.
YouTrack provides default values for JVM options that affect the performance and memory allocation for your YouTrack installation. For a complete list, see Default JVM Options.
Other parameters affect the availability of specific features and other application behavior. For a complete list of YouTrack-specific configuration parameters, see Configuration Parameters.
JVM options that differ from the default configuration are stored in an internal file named youtrack.jvmoptions
. Every time you start the YouTrack service, YouTrack reads this file and applies the parameters that are stored in this configuration to the YouTrack 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 youtrack.jvmoptions
file. You can update the file programmatically, or manually change the settings in the file.
When you set a YouTrack property or JVM option, the property is applied on every server restart.
You can set properties and JVM options for your server with the configure
command. You can use this method for any type of YouTrack installation.
When you set JVM options from the command line, consider the following guidelines:
Always execute the
configure
command on behalf of the OS user that runs the YouTrack service. This command creates configuration files and folders. The YouTrack service user should have sufficient permissions to access these files and folders.To set the parameter for a JVM option, enter the
configure
command with the prefix-J
. The-J
prefix signifies that a JVM option is declared after it. You must add the-J
prefix to each JVM option that you want to configure.The
D
prefix signifies that the name value pair that follow it are used as a system property within the JVM.To define an option passed to YouTrack by the JVM on start, use
-
before the parameter name:youtrack configure -J-<jvm.property>[=<value>]
For example:
youtrack configure -J-Dorg.eclipse.jetty.server.Request.maxFormKeys=10000 youtrack configure -J-Xmx1024m -J-XX:+HeapDumpOnOutOfMemoryError
To remove a JVM option, use
+
before the parameter name:youtrack configure -J+<jvm.property>[=<value>]
The constructions
+option=<value>
,+XX:<option>=<value>
and+D<property>=<value>
remove the corresponding option only if it has exactly the same value.For example:
youtrack configure -J+Dorg.eclipse.jetty.server.Request.maxFormKeys=10000
The constructions
+option
,+XX:<option>
and+D<property>
remove the corresponding option regardless of the value.For example:
youtrack configure -J+ea
note
The steps for performing this operation vary by installation type. Before you start, make sure you have selected the tab that corresponds to your YouTrack installation.
Stop YouTrack:
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 following command:
LinuxWindowsdocker run --rm -it \ -v <path to conf directory>:/opt/youtrack/conf \ jetbrains/youtrack:<version> \ configure -J-<jvm.property>=<value>
docker run --rm --it ^ -v <path to conf directory>:/opt/youtrack/conf ^ jetbrains/youtrack:<version> ^ configure -J-<jvm.property>=<value>
Replace
<jvm.property>
with the name of the property that you want to update.Replace
<value>
with the value that you want to set.
For example:
configure -J-Dstatistics-upload=true
Start YouTrack:
docker start <containerId>
Open a command-line interface and enter the following command to stop the YouTrack service:
youtrack.sh stop
Enter the
configure
command. For example:<youtrack_home>bin/youtrack.sh configure -J-Dstatistics-upload=true
Use the following command to restart the YouTrack service:
youtrack.sh restart
You can configure JVM options manually by editing the youtrack.jvmoptions
file. This file is created automatically when you modify the default configuration. The location of the file depends on the distribution type of your YouTrack installation.
note
Changing Database LocationYou cannot change the database location manually. This parameter is rewritten on server start. To change the database location, 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 youtrack.jvmoptions.dist file and save it as youtrack.jvmoptions
or
Create a youtrack.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 as described in the following procedure.
note
The steps for performing this operation vary by installation type. Before you start, make sure you have selected the tab that corresponds to your YouTrack installation.
Stop YouTrack:
docker exec <containerId> stop
Open the youtrack.jvmoptions file.
For a Docker image, the file is located in the
conf
directory on the host machine that is mapped to the/opt/youtrack/conf
directory inside the container.Start YouTrack:
docker start <containerId>
Open a command-line interface and enter the following command to stop the YouTrack service:
youtrack.sh stop
Open the youtrack.jvmoptions file.
For a ZIP distribution, the file is located in the
<YouTrack 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 YouTrack service:
youtrack.sh restart
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 youtrack.jvmoptions
file and runs YouTrack 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.
note
The steps for performing this operation vary by installation type. Before you start, make sure you have selected the tab that corresponds to your YouTrack installation.
Use the following command to stop the YouTrack 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/youtrack/conf \ jetbrains/youtrack:<version> \ configure-next-start \ <ad hoc JVM options>
docker run -it --rm ^ -v <path to conf directory>:/opt/youtrack/conf ^ jetbrains/youtrack:<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 YouTrack 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/youtrack/conf jetbrains/youtrack:<version> \ configure-next-start \ --J-XX:+HeapDumpOnOutOfMemoryError \ --J-Xmx1024m
docker run -it --rm ^ -v <path to conf directory>:/opt/youtrack/conf ^ jetbrains/youtrack:<version> ^ configure-next-start ^ --J-XX:+HeapDumpOnOutOfMemoryError ^ --J-Xmx1024m
Restart the YouTrack service:
docker start <containerId>
The YouTrack service starts using the specified settings.
The
youtrack.jvmoptions
file is not modified.
In a command-line interface, enter the following command to stop the YouTrack service:
youtrack.sh stop
Change the directory to
<youtrack_home>/bin
.For a ZIP installation, the
<youtrack_home>
directory is the location where the ZIP distribution was unpacked during installation.Enter the
youtrack.sh start
command, followed by the settings that you want to pass to the YouTrack 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:
youtrack.sh start --J-XX:+HeapDumpOnOutOfMemoryError --J-Xmx1024m
The YouTrack service starts using the specified settings.
The
youtrack.jvmoptions
file is not modified.
To run YouTrack with the previous settings, restart the service without passing any custom parameters.
After changing JVM options for your YouTrack installation you might want to check that your changes are applied. To do so, you can use a list jvm-options
command. It produces a list of JVM properties that will be applied to the YouTrack instance on the next start. Please note that the output of the command lists only persistent JVM options. Any options that are provided ad hoc in the command to run YouTrack will override the value of the same persistent option.
To run YouTrack, the following JVM options are set by default for all installations:
Setting | JVM Option | Value |
---|---|---|
Maximum Metaspace memory |
|
|
Maximum Java heap size |
|
|
note
Smart Memory ManagementWhenever the application is restarted, it checks the current database size, excluding BLOBs (binary large objects, like attachments and large blocks of text).
If the database exceeds the maximum Java heap size that is currently allocated to run the application, it automatically increases the allocation by 250 MB unless this number would be greater than 80% of the total memory available to the application.
The application will continue to increase the maximum heap size until it covers the size of the existing database or reaches the 80% limit.
The following JVM options help you manage and improve the performance of your YouTrack installation:
Setting | JVM Option | Value |
---|---|---|
Minimum Metaspace memory |
|
|
Thanks for your feedback!