IntelliJ IDEA 14.1.0 Help

Increasing Memory Heap

To prevent the build process from running out of memory, you can increase the amount of memory allocated to the process. By default, the memory heap is 128 MB, but for large projects you may need more.

In this section:

Increasing memory heap of the build process

To increase a memory heap

  1. Open the Build File Properties dialog box.
  2. In the Maximum heap size field, type the required amount of memory.

Important notes

Please note the following:

The memory heap of the build process is independent of IntelliJ IDEA memory heap, and is released after the build process is complete.

The memory heap available to IntelliJ IDEA may be changed by editing the corresponding VM options. Depending on the platform, these files are:

  • Windows: idea.exe.vmoptions
  • Linux: idea.vmoptions
  • OS X:

    Since version 12.0.0:
    The file /Applications/IntelliJ should be copied to ~/Library/Preferences/IntelliJ IDEAXX/idea.vmoptions

    Since version 14.0.0:
    The file /Applications/IntelliJ should be copied to ~/Library/Preferences/IntelliJ IDEAXX/idea.vmoptions

    For the older versions, the settings are stored in Info.plist.

Alternatively, for the Windows and *NIX platforms, one can increase IntelliJ IDEA heap size without editing files located under the IntelliJ IDEA installation folder. This is done in one of the following ways:

  • Specify env_var environment variable. This variable should contain the path to the file with the settings.
  • Create $HOME/.prod1/idea$BITS.vmoptions (for *NIX) or %USERPROFILE%\.prod1\idea%BITS%.exe.vmoptions (for Windows) respectively.

    The value of the variable BITS:

    • For 32-bit systems it is empty.
    • For 64-bit systems it is 64.

    Finally, you have to create:

    For *NIX 32-bit: $HOME/.prod1/idea.vmoptions

    For *NIX 64-bit: $HOME/.prod1/idea64.vmoptions

    For Windows 32-bit: %USERPROFILE%\.prod1\idea.exe.vmoptions

    For Windows 64-bit: %USERPROFILE%\.prod1\idea64.exe.vmoptions

If env_var environment variable is defined, or the file $HOME/.prod1/idea$BITS.vmoptions (for *NIX) or %USERPROFILE%\.prod1\idea%BITS%.exe.vmoptions (for Windows) exists, then this file is used instead of the file located in the IntelliJ IDEA installation folder.

Thus, to avoid editing files in the IntelliJ IDEA installation folder, one should:

  1. Do one of the following:
    • Copy <IntelliJ IDEA installation folder>/bin/prod1.vmoptions to $HOME/.prod1/idea$BITS.vmoptions (for *NIX) or %USERPROFILE%\.prod1\idea%BITS%.exe.vmoptions (for Windows)
    • Copy <IntelliJ IDEA installation folder>/bin/prod1.vmoptions somewhere and save the path to this location into the environment variable env_var
  2. Edit the file in the new location.

See Also

Last modified: 14 July 2015