You can increase IntelliJ’s memory allocation by editing the VM options:

Quick method:

  1. Help → Change Memory Settings — lets you adjust the heap size directly from the IDE

Manual method:

Edit the VM options file:

  1. Help → Edit Custom VM Options (creates the file if it doesn’t exist)
  2. Modify these lines:
-Xms512m
-Xmx4096m
  • -Xms — initial heap size
  • -Xmx — maximum heap size (this is the main one to increase)

File locations (if editing manually):

  • Linux: ~/.config/JetBrains/IntelliJIdea2024.x/idea64.vmoptions
  • Windows: %APPDATA%\JetBrains\IntelliJIdea2024.x\idea64.vmoptions

Restart IntelliJ after making changes. You can verify the new settings via Help → About — it shows current heap usage and max.