Intellij idea Heap size can not be changed

时光总嘲笑我的痴心妄想 提交于 2019-12-24 05:52:26

问题


Someday, I run something huge, and a window pop up said that heap memory out of memory, I set it to 2014M in that window, then click continue. Everything was fine.

But I don't like the number 2014, I want it 2048. So, I changed -Xmx option in idea64.exe.vmoptions (like below) and restarted idea. (According to this doc) However, nothing was changed, heap size was still 2014M.

-Xms512m
-Xmx2048m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow

Then, I changed all idea64.exe.vmoptions I could find, and restarted, and still failed.

OS: windows 10 64-bit
idea version: 2018.1

How can I change the heap size to 2048M ?

Please help, thanks.

update:

That day, I was debugging with some codes which encrypt some huge objects, and the popup showed just after I use copy value function.

I tried to change the heap size of IntelliJ Idea's JVM as the official document, but not working.

The heap memory statistic is here:

update 2:

The log:

2018-07-23 09:54:04,184 [    224]   INFO -        #com.intellij.idea.Main - JVM Args: -Xms512m -Xmx2048m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Djb.vmOptionsFile=C:\Users\huayu\.IntelliJIdea2018.1\config\idea64.exe.vmoptions -Didea.jre.check=true -Dide.native.launcher=true -Didea.paths.selector=IntelliJIdea2018.1 -XX:ErrorFile=C:\Users\huayu\java_error_in_idea_%p.log -XX:HeapDumpPath=C:\Users\huayu\java_error_in_idea.hprof 

回答1:


Newer versions of IDEA use a different file for vm options. Older versions used to use C:\Program Files\JetBrains\IntelliJ IDEA {version}\bin\idea64.exe.vmoptions but now these configurations exist in C:\Users{user}.IntelliJIdea{version}\config\idea64.exe.vmoptions.

You can get to this file from IntelliJ. On the Help menu, click Edit Custom VM Options. Then restart IDEA and it should update.

Note: It doesn't look like the value displayed in the bottom right will exactly match what you specify in the config file. Not sure why.

See also: How to increase the memory heap size on IntelliJ IDEA?




回答2:


You changed the heap size of the project you were running within IntelliJ, not the heap size of IntelliJ itself, when you got to that popup. You would set that in the run configuration for your project.

The startup options change the heapsize of IntelliJ itself, which is not shown on screen constantly.




回答3:


I have just realised that the memory indicator which is showing the values are coming from 32bit vmoptions file while I'm running the 64 bit idea. And hence the indicator is not showing the correct values.



来源:https://stackoverflow.com/questions/51436569/intellij-idea-heap-size-can-not-be-changed

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