29

My settings for these values in eclipse.ini are:

-Xms768M
-Xmx1024M

When setting them higher, Eclipse doesn't start anymore. Is there a way to increase these values without Eclipse crashing?

zb226
  • 9,586
  • 6
  • 49
  • 79
Lieven Cardoen
  • 25,140
  • 52
  • 153
  • 244
  • Since it depends on the operating system, see [Sizing the Java Heap](http://publib.boulder.ibm.com/infocenter/javasdk/tools/index.jsp?topic=/com.ibm.java.doc.igaa/_1vg00014884d287-11c3fb28dae-7ff6_1001.html) – stacker Nov 29 '10 at 13:50
  • 1
    [This](http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html) article should be helpful. It will show you which errors to avoid when setting the java heap size (the heap size shouldn't be greater than the physical memory in your PC for example). – kgiannakakis Nov 29 '10 at 13:59
  • http://wiki.eclipse.org/Eclipse.ini - http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#generation_sizing – Andrew May 11 '18 at 12:54

4 Answers4

31

The maximum values do not depend on Eclipse, it depends on your OS (and obviously on the physical memory available).

You may want to take a look at this question: Max amount of memory per java process in Windows?

Community
  • 1
  • 1
Guillaume
  • 5,535
  • 1
  • 24
  • 30
9

I am guessing you are using a 32 bit eclipse with 32 bit JVM. It wont allow heapsize above what you have specified.

Using a 64-bit Eclipse with a 64-bit JVM helps you to start up eclipse with much larger memory. (I am starting with -Xms1024m -Xmx4000m)

Kichu
  • 667
  • 1
  • 6
  • 9
8

Why do you need -Xms768 (small heap must be at least 768...)?

That means any java process (search in eclipse) will start with 768m memory allocated, doesn't that? That is why your eclipse isn't able to start properly.

Try -Xms16 -Xmx2048m, for instance.

akjoshi
  • 15,374
  • 13
  • 103
  • 121
tolki zianon
  • 81
  • 1
  • 1
7

I have tried the following config for eclipse.ini:

org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
1024M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
1024m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms128m
-Xmx2048m

Now eclipse performance is about 2 times faster then before.

You can also find a good help ref here: http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html

Dennis Ahaus
  • 969
  • 1
  • 8
  • 17
  • The command line arguments did not overwrite what was defined in the .ini file. So editing the .ini file was the only solution for me. – holzkohlengrill Jun 18 '20 at 08:28