Unable to change memory settings INTELLIJ IDEA
Answered
I kept getting the error "Exception in thread "main" java.lang.OutOfMemoryError: Java heap space" when I was try to run my code.
I found out that I should change the memory settings, but despite that I set the Maximum Heap Size to 4096 MB, after INTELLIJ has restarted, the Maximum Heap Size is still set at 2048 MB.
I have also tried to add "-Xmx4096m" to vmoptions, but the Maximum Heap Size setting still won't change, and I keep getting the OutOfMemoryError. When I ran the program after all this task manager showed that the memory usage of INTELLIJ never exceeded 2100 MB.
If anyone knows how to fix this, please let me know.
Vmoptions:

Memory setting:

Please sign in to leave a comment.
IntelliJ IDEA memory settings do not affect the memory of your application. You should use VM Options field of the Run/Debug configuration instead.
I just installed IDEA Ultimate and am unable to adjust the IDEA memory settings. The default is 2048. I tried to change it to 4096, and clicked Save and Restart. It is now hanging (beachball). Even if I don't change anything and click Save and Restart it hangs. I uninstalled and re-installed with the same result, and also rebooted the Mac. Any ideas what is wrong? The version is.
IntelliJ IDEA 2020.3.3 (Ultimate Edition)
Build #IU-203.7717.56, built on March 15, 2021
Licensed to IntelliJ IDEA Evaluator
Expiration date: April 23, 2021
Runtime version: 11.0.10+8-b1145.96 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.16
GC: ParNew, ConcurrentMarkSweep
Memory: 3987M
Cores: 16
Please provide the thread dumps per https://intellij-support.jetbrains.com/hc/en-us/articles/206544899.
Try the steps from https://intellij-support.jetbrains.com/hc/en-us/articles/360007568559.
The files can be shared at https://uploads.jetbrains.com or you can file a ticket with the files attached at https://intellij-support.jetbrains.com/hc/requests/new.
Thanks.