16

When I run my project in IntelliJ in debug mode I get the following error.

Does anybody know what is the cause? enter image description here

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

Tom
  • 16,842
  • 17
  • 45
  • 54
itro
  • 7,006
  • 27
  • 78
  • 121
  • It isn't a regular practice to have outofmemoryexceptions generally this means your code is poorly optimized probably written wrongly somewhere. Although it is possible to increase heap size the general cause isn't the actually heap size and it more likely programming conventions or mistakes. Come back with code, show us your thread. – Ya Wang Feb 09 '15 at 14:22
  • 5
    I ran into this issue, and increasing "Build process heap size" fixed it for me – Yevgen Yampolskiy Dec 17 '16 at 07:37

2 Answers2

13

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 JVM?

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.

Mike Nakis
  • 56,297
  • 11
  • 110
  • 142
0

It is very strange still i don't understand why but I resolved it by decreasing the size of VM Options: -Xmx820m. Maybe because i use jre 32 bit en my Intellij IDE runs on 64 bit.

itro
  • 7,006
  • 27
  • 78
  • 121