When I run my project in IntelliJ in debug mode I get the following error.
Does anybody know what is the cause?
I already increased my heap size in idea.vmoptions
:
-ea
-server
-Xms1g
-Xmx3G
-Xss16m
-Xverify:none
-XX:PermSize=512m
-XX:MaxPermSize=1024m
I already increased my heap size for compiler to 1024 as bellow:
From the main menu, select Help | Change Memory Settings. Set the necessary amount of memory that you want to allocate and click Save and Restart.
IntelliJ IDEA memory usage Follow IntelliJ itself reports that it is using a little more than 1GB of heap but the OS reports that it is using anywhere from 3.5 to 4.5 GB.
Easy way to solve OutOfMemoryError in java is to increase the maximum heap size by using JVM options -Xmx512M , this will immediately solve your OutOfMemoryError.
From the main menu, select View | Tool Windows | Profiler. Right-click the necessary process in the Profiler tool window and select CPU and Memory Live Charts. A new tab opens in which you can see the amount of resources the selected process consumes.
You have tried:
Increasing the heap size of the IntelliJ IDEA IDE, which has absolutely no effect on how much memory is available to your program at runtime, and
Increasing the heap size for the compiler, which also has absolutely no effect on how much memory is available to your program at runtime.
Try Run
menu -> Edit Configurations...
-> find your project in the tree of projects on the left, look for VM options:
in the panel on the right, and enter something there, according to information found here: What are the Xms and Xmx parameters when starting JVMs?
That having been said, I should also add that if you are running out of memory without knowingly doing extremely memory hungry stuff, then what you have in your hands is a bug which is causing your program to do runaway memory allocation, which will always be resulting in out-of-memory errors no matter how much you increase your heap size. In that case, you will need to look at your code, not at your project options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With