Intellij heap size, Initial heap size set to a larger value than the maximum heap size

김상기 picture 김상기 · Nov 2, 2017 · Viewed 19.1k times · Source

I'm a beginner in Java, and I just started using Intellij as my IDE.

When I use it, sometimes it's delayed.

I changed my xms and xmx for larger heap size (xms = 1024, xmx = 2048), but it throws an error.

So, I rolled it back.

The error message was something like this: "Initial heap size set to a larger value than the maximum heap size".

What is the problem?

If possible, how do I increase maximum heap size?

I'm using a laptop and it has 8GB memory. x64 Intellij.exe used.

Answer

BrianC picture BrianC · Aug 19, 2019

If you are seeing this error in InteliJ after the 2019.2 update it is because the update changed the JVM XMX value to 2048m without checking the related values which can allow XMS to become larger than the max XMX value which is not valid and creates that error.

i.e. The values for me had been XMX=6000m and XMS=4096m but after the 2019.2 update they were XMX=2048m and XMS=4096m

You will have to manually change the values so XMS is equal to or less than XMX. On Macs the VM options file is ~/Library/Preferences/IntelliJIdea2019.2/idea.vmoptions

NOTE: That path assumes you are on InteliJ version 2019.2. You will need to change that value in the path to the version you are on if