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.
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:
- OS X:
For Mac OS X systems:
Since version 12.0.0: The file
/Applications/IntelliJ Idea XX.app/bin/idea.vmoptionsor
/Applications/IntelliJ Idea CE XX.app/bin/idea.vmoptionsshould be copied to
Since version 14.0.0:The file
/Applications/IntelliJ Idea XX.app/Contents/bin/idea.vmoptionsor
/Applications/IntelliJ Idea CE XX.app/Contents/bin/idea.vmoptionsshould be copied to
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
- Copy the existing file
<IntelliJ IDEA installation folder>/bin/idea$BITS.vmoptionsfrom the IntelliJ IDEA installation folder into the location under user home:
- For *NIX:
- For Windows:
The value of the variable BITS depends in the JVM used to run IntelliJ IDEA:
- For 32-bit JVM it is empty.
- For 64-bit JVM it is 64.
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.
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.