29

I just installed Eclipse 4.2 (Juno) on Linux 64 bit. I have looked at several Eclipse.ini threads on Stack Overflow, but I still don't understand the relationship between the different memory parameters.

On one hand, there are parameters that are for the VM and that go under -vmargs (for example, -Xms and -Xmx, -XX), while others (for example, --launcher.XXMaxPermSize) are provided to Eclipse directly.

What is the relationship between these parameters? How would I set them up for a machine with more than 8 GB of memory?

I am aware of the long Stack Overflow question What are the best JVM settings for Eclipse?, but I would like to learn how to adjust these parameters myself.

For reference, after installation, the default parameters that Juno has are:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.v20120522-1813
-product
org.eclipse.epp.package.cpp.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
Community
  • 1
  • 1
Josh
  • 11,979
  • 17
  • 60
  • 96

2 Answers2

19

If you are running Eclipse on an Oracle/Sun JVM, I would disregard --launcher.XXMaxPermSize (I personally remove it) and concentrate on -XX:MaxPermSize, -Xms and -Xmx.

The reason for --launcher.XXMaxPermSize is that some non-Oracle/Sun JVMs would choke on -XX:MaxPermSize. The launcher is programmed to detect the JVM and conditionally supply -XX:MaxPermSize. This of course is defeated by the explicit -XX:MaxPermSize setting in the default eclipse.ini file. That looks like a bug.

I never mess with -Xms setting. I set -Xmx1024m and -XX:MaxPermSize=512m.

Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
Konstantin Komissarchik
  • 28,879
  • 6
  • 61
  • 61
0

For the sake of completeness, it should be noted that the permanent generation (PermGen) was replaced with MetaSpace in Java 8 HotSpot.

So, if you're using an Oracle JVM with Java 8 or higher you don't have to worry about these parameters anymore and can safely remove those from you eclipse.ini:

--launcher.XXMaxPermSize
-XX:MaxPermSize

Since then the -XX:MaxPermSize parameter is ignored by the JVM and generates a warning (See: PermGen elimination in JDK 8).

Yosh
  • 706
  • 5
  • 15