Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 
like image 626
Zhili Avatar asked Oct 24 '25 22:10

Zhili


2 Answers

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

like image 200
Goran Siriev Avatar answered Oct 27 '25 17:10

Goran Siriev


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?

like image 41
Kosi Avatar answered Oct 27 '25 16:10

Kosi