Changing memory settings in eclipse.ini causes Could not create JVM

eclipse, java, jvm

Solution

For one thing, you should never set your Xms to the same amount as Xmx because this will effectively cause the garbage collector to never run until your Java VM memory is completely used up. Set Xmx to the maximum memory you want to allocate to the Java applications and VM, and Xms to the maximum amount of memory the VM should use without bothering too much to garbage collect. You may find this will solve your problem.

Problem

I have a following problem. When I try to raise memory for JVM in `eclipse.ini` file, I always get `Could not create Java Virtual Machine` exception. My current memory settings are ``` -Xms1024m -Xmx1024m -Xmn256m -Xss2m ``` And I would like to raise them to ``` -Xms2048m -Xmx2048m -Xmn512m -Xss2m ``` I am running on 32-bit Java, JDK 1.6. I have a 64-bit machine with 12GB of memory. The reason I am not using a 64-bit Java is that we have encountered some problemes during develepment of our apps, so we switched back to 32-bit one. Thanks a lot for advices. EDIT Ok, so here is my stack trace, it occurs when I try to run Eclipse. Also notice that I have `Xms` parameter set only to 512M but it works when it's set to 1024M, but it seems too much for one (even big) web app.

Original source

Related problems