Zhili
Zhili

Reputation: 161

Intellij idea Heap size can not be changed

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

enter image description here

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

enter image description here

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:

enter image description 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 

Upvotes: 4

Views: 2773

Answers (4)

Goran Siriev
Goran Siriev

Reputation: 703

After Hours and hours searching. On windows 10 Control Panel => System => Advanced system settings System Properties => Advanced Environment Variebles

_JAVA_OPTIONS -Xmx8192M enter image description here

Upvotes: 4

Sri Ten
Sri Ten

Reputation: 1

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.

Upvotes: 0

Kosi
Kosi

Reputation: 288

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?

Upvotes: 3

jwenting
jwenting

Reputation: 5663

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.

Upvotes: 0

Related Questions