CLion 2019.3 Help

Advanced configuration

Besides the standard options available in the Settings/Preferences dialog Ctrl+Alt+S, CLion enables you to perform low-level configuration of the underlying platform and the Java runtime.

JVM options

CLion runs on the Java Virtual Machine (JVM), which has various options that control its performance. The default options used to run CLion are specified in the following file:

<IDE_HOME>\bin\clion64.exe.vmoptions

CLion.app/Contents/bin/clion.vmoptions

<IDE_HOME>/bin/clion64.vmoptions (for the default 64-bit JVM)

<IDE_HOME>/bin/clion.vmoptions (for the optional 32-bit JVM)

Configure JVM options

Do one of the following to create a copy of the default file with JVM options in the configuration directory that will override the values from the original file:

  • On the Help menu, click Edit Custom VM Options.

  • If you do not have any project open, on the Welcome screen, click Configure and then Edit Custom VM Options.

  • If you cannot start CLion, manually copy the default file with JVM options to the CLion configuration directory.

If you do not have write access to the CLion configuration directory, you can add the CLION_VM_OPTIONS (CLION64_VM_OPTIONS on Windows) environment variable to specify the location of the file with your preferred JVM options. The values in this file will override the corresponding values from both the original default file and the copy located in the CLion configuration directory.

Common options

The default values of the JVM options should be optimal in most cases. The following are the most commonly modified ones:

Option

Description

-Xmx

Limits the maximum memory heap size that the JVM can allocate for running CLion. Default value depends on the platform. If you are experiencing slowdowns, you may want to increase this value, for example, to set the value to 2048 megabytes, change this option to -Xmx2048m.

-Xms

Specifies the initial memory allocated by the JVM for running CLion. Default value depends on the platform. It is usually set to about half of the maximum allowed memory (-Xmx), for example, -Xms1024m.

-XX:NewRatio

Specifies the ratio between the size of the young and old generation of the heap. In most cases, a ratio between 2 and 4 is recommended. This will set the size of the young generation to be 1/2 to 1/4 of the old generation correspondingly, which is good when you are often working on one project and only a few files at a time. However, if you are constantly opening new files and switching between several projects, you may need to increase the young generation. In this case, try setting -XX:NewRatio=1, which will make the young generation as large as the old generation, allowing objects to remain in the young generation for longer.

For more information about available JVM options, see the java reference for Windows or macOS/Linux.

Platform properties

CLion enables you to customize various platform-specific properties, such as the path to user-installed plugins and the maximum supported file size. The default properties used to run CLion are specified in the following file:

<IDE_HOME>\bin\idea.properties

CLion.app/Contents/bin/idea.properties

<IDE_HOME>/bin/idea.properties

Configure platform properties:

Do one of the following to create an empty idea.properties file in the configuration directory that will override the values from the original file:

  • From the Help menu, select Edit Custom Properties.

  • If you do not have any project open, on the Welcome screen, click Configure and then select Edit Custom Properties.

  • If you cannot start CLion, manually create an empty idea.properties file in the CLion configuration directory.

If you do not have write access to the CLion configuration directory, you can add the CLION_PROPERTIES environment variable to specify the location of the idea.properties file. The properties in this file will override the corresponding properties in both the original default file and the one located in the CLion configuration directory.

Common properties

Users often change the following properties:

  • The default IDE directories may need to be moved, for example, if the user profile drive runs out of space or it is located on a slow disk, if the home directory is encrypted (slowing down the IDE) or located on a network drive, if you want to create a portable installation or exclude caches from home directory backups, and so on.

    Property

    Path to

    idea.config.pathConfiguration directory
    idea.system.pathSystem directory
    idea.plugins.pathPlugins directory
    idea.log.pathLogs directory

    Specify paths with forward slashes /, including Windows paths (for example, C:/idea/system).

    You can insert properties as variables. For example, use ${user.home} (standard Java system property) to specify paths relative to the user's home directory:

    idea.config.path=${user.home}/MyIdeaConfiguration
  • Limits that can affect performance:

    Property

    Description

    idea.max.content.load.filesize

    Maximum size of files (in kilobytes) that CLion is able to open. Working with large files can affect editor performance and increase memory consumption. The default value is 20000.

    idea.max.intellisense.filesize

    Maximum size of files (in kilobytes) for which CLion provides coding assistance. Coding assistance for large files can affect editor performance and increase memory consumption. The default value is 2500.

    idea.cycle.buffer

    Maximum size of the console cyclic buffer (in kilobytes). If the console output size exceeds this value, the oldest lines are deleted. To disable the cyclic buffer, set idea.cycle.buffer.size=disabled.

    idea.max.vcs.loaded.size.kb

    Maximum size (in kilobytes) that CLion loads for showing past file contents when comparing changes. The default value is 20480.

CLion provides a number of other properties that define interaction with the environment (window managers, launchers, file system, and so on). Most of them act like hidden settings (in the sense that they are not evidently exposed), which you may need to enable or disable in certain cases. Change these properties only if advised by JetBrains Support.

Default IDE directories

By default, CLion stores user-specific files (configuration, caches, plugins, logs, and so on) in the user's home directory. However, you can change the location for storing those files, if necessary.

Configuration directory

The CLion configuration directory contains XML files with personal settings, such as keymaps, color schemes, and so on. It is also the default location for user-defined VM options and platform properties files.

Syntax
%HOMEPATH%\.<product><version>\config
Example
C:\Users\JohnS\.CLion2019.3\config
Syntax
~/Library/Preferences/<product><version>
Example
~/Library/Preferences/CLion2019.3
Syntax
~/.<product><version>/config
Example
~/.CLion2019.3/config

You can change the location of the CLion configuration directory using the idea.config.path property.

You can share your personal IDE settings by copying the files from the configuration directory to corresponding folders on another CLion installation. Make sure that CLion is not running to avoid erasing the copied files when you shut down the IDE. The following table lists subfolders in the CLion configuration directory and corresponding settings that are contained in them.

Directory

User settings

codestylesCode style schemes
colors

Customized editor color and font schemes

fileTemplates

User-defined file templates which pertain to the entire CLion workspace

filetypes

User-defined file types

inspectionCode inspection profiles
keymaps

Customized keyboard shortcuts

options

Various options, for example, feature usage statistics and macros

scratchesScratch files and buffers
templates

User-defined live templates

tools

Configuration files for user-defined external tools

shelf

Shelved changes

System directory

The CLion system directory contains caches and local history files.

Syntax
%HOMEPATH%\.<product><version>\system
Example
C:\Users\JohnS\.CLion2019.3\system
Syntax
~/Library/Caches/<product><version>
Example
~/Library/Caches/CLion2019.3
Syntax
~/.<product><version>/system
Example
~/.CLion2019.3/system

You can change the location of the CLion system directory using the idea.system.path property.

Plugins directory

The CLion plugins directory contains user-installed plugins.

Syntax
%HOMEPATH%\.<product><version>\config\plugins
Example
C:\Users\JohnS\.CLion2019.3\config\plugins
Syntax
~/Library/Application Support/<product><version>
Example
~/Library/Application Support/CLion2019.3
Syntax
~/.<product><version>/config/plugins
Example
~/.CLion2019.3/config/plugins

You can change the location of the CLion plugins directory using the idea.plugins.path property.

Logs directory

The CLion logs directory contains product logs and thread dumps.

Syntax
%HOMEPATH%\.<product><version>\system\log
Example
C:\Users\JohnS\.CLion2019.3\system\log
Syntax
~/Library/Logs/<product><version>
Example
~/Library/Logs/CLion2019.3
Syntax
~/.<product><version>/system/log
Example
~/.CLion2019.3/system/log

You can change the location of the CLion logs directory using the idea.log.path property.

Adjusting CPU Cores Number

You can adjust the number of CPU cores to be used by the IDE when running the active tasks (e.g indexing header files, updating symbols, and so on) in order to keep the performance properly balanced between CLion and other applications running on your machine.

To set up the number of CPU cores:

  1. Go to the Help | Find Action main menu option or hit Ctrl+Shift+A. In the dialog that opens start typing Registry:

    Registry action
    Select Registry from the list of suggested options.

  2. In this dialog, start typing cidr.indexer.thread.count. The IDE highlights the corresponding key.

    Registry dialog

    Click the Value field of the highlighted string and enter the desired number of CPU cores assuming the following:

    • Negative value N means that the actual number of CPU cores will be reduced by N to determine how many cores will be used. For example, for 8 cores CPU the value -1 means, that 7 cores shall be used.

    • Zero value means that every available core shall be used.

    • Positive value determines the cores number to be used directly.

Last modified: 20 February 2020