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
- Open the Build File Properties dialog box.
- 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:
For Mac OS X systems:
Since version 12.0.0: The file
/Applications/IntelliJ Idea XX.app/bin/idea.vmoptions
or/Applications/IntelliJ Idea CE XX.app/bin/idea.vmoptions
should be copied to~/Library/Preferences/IntelliJIdeaXX/idea.vmoptions
or~/Library/Preferences/IdeaICXX/idea.vmoptions
Since version 14.0.0:
The file/Applications/IntelliJ Idea XX.app/Contents/bin/idea.vmoptions
or/Applications/IntelliJ Idea CE XX.app/Contents/bin/idea.vmoptions
should be copied to~/Library/Preferences/IntelliJIdeaXX/idea.vmoptions
or~/Library/Preferences/IdeaICXX/idea.vmoptions
For the older versions, the settings are stored in
/Applications/IntelliJ IDEA <version>.app/Contents/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:
To avoid editing files in the IntelliJ IDEA installation folder, one should:
- Do one of the following:
- Copy the existing file from the IntelliJ IDEA installation folder somewhere and save the
path to this location in the environment variable
IDEA_VM_OPTIONS
. - Copy the existing file
<IntelliJ IDEA installation folder>/bin/idea$BITS.vmoptions
from the IntelliJ IDEA installation folder into the location under user home:- For *NIX:
$HOME/.IntelliJIdeaXX/idea$BITS.vmoptions
or$HOME/.IdeaICXX/idea$BITS.vmoptions
- For Windows:
%USERPROFILE%\.IntelliJIdeaXX\idea%BITS%.exe.vmoptions
or%USERPROFILE%\.IdeaICXX\idea%BITS%.exe.vmoptions
The value of the variable BITS depends in the JVM used to run IntelliJ IDEA:
Refer to the support article Selecting the JDK version the IDE will run under for details.
- For *NIX:
- Copy the existing file from the IntelliJ IDEA installation folder somewhere and save the
path to this location in the environment variable
- Edit this file in the new location.
If IDEA_VM_OPTIONS
environment variable is defined, or the
*.vmoptions
file exists,
then this file is used instead of the file located in the IntelliJ IDEA installation folder.