How to increase the memory heap size on IntelliJ IDEA?

99封情书 提交于 2019-12-28 02:55:05

问题


I want to allocate around 1GB of heap size, but I can't seem to figure it out.

How to do this?


回答1:


Use Help | Edit Custom VM Options…

An editor will open automatically for the right .vmoptions file, adjust the value of -Xmx, save and restart IntelliJ IDEA:

Check these documents from IntelliJ IDEA knowledge base for more details:

  • Configuring JVM options and platform properties
  • The JVM could not be started. The main method may have thrown an exception.

Answers below suggest to edit .vmoptions file directly inside the application installation directory. Please note that it's not recommended since it will cause conflicts during patch updates. The method above creates a copy of the file in the CONFIG directory and your IDE installation remains intact.

Also be aware of the 32-bit address space limit on Windows which makes it hard to use heap sizes higher than 750m. Should you need to use larger heap, make sure to switch to the 64-bit JVM first, otherwise IDE may crash on start or start to crash randomly during work.




回答2:


go to that path "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1.4\bin\idea.exe.vmoptions" and change size to -Xmx512m

  -Xms128m
  -Xmx512m
  -XX:MaxPermSize=250m
  -XX:ReservedCodeCacheSize=64m
  -XX:+UseCodeCacheFlushing
  -ea
  -Dsun.io.useCanonCaches=false
  -Djava.net.preferIPv4Stack=true

hope its will work




回答3:


For 64-bit Windows, make sure to run idea in 64 bit mode(idea64.exe) and change settings in "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.1\bin\idea64.exe.vmoptions" file. These settings works fine for me

-Xms512m
-Xmx2024m
-XX:MaxPermSize=700m
-XX:ReservedCodeCacheSize=480m



回答4:


For developers who use Ubuntu, following will help to increase heap size in InteliJ Idea. Following versions are used by myself at the moment.

  • Ubuntu 16.04 LTS (64 bit)

  • InteliJ IDEA 2016.3.4

Go to the location where the IDE is installed and find the following file. (In my case it as follows)

/home/abcde/Softwares/idea-IU-163.12024.16/bin

Then select the idea64.vmoptions file and edit it.

Remove default configuration and paste the below mentioned.

-Xms512m
-Xmx2024m
-XX:MaxPermSize=700m
-XX:ReservedCodeCacheSize=480m

Now restart the IDE and changes should reflect the IDE environment.

Worked for me to overcome Java heap size related issues.




回答5:


In addition to what others have added, should the error persist try this





basically put what you want(as others have pointed out) in your run-config's vm options and apply




回答6:


You can easily increase memory heap from IntelliJ IDEA version 2019.2 by using Help | Change Memory Settings.

Please check this document for details: https://www.jetbrains.com/help/idea/increasing-memory-heap.html



来源:https://stackoverflow.com/questions/17221725/how-to-increase-the-memory-heap-size-on-intellij-idea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!