What are the best JVM settings for Eclipse? [close

2018-12-30 23:39发布

What are the best JVM settings you have found for running Eclipse?

标签: eclipse jvm
16条回答
琉璃瓶的回忆
2楼-- · 2018-12-31 00:12

Eclipse likes lots of RAM. Use at least -Xmx512M. More if available.

查看更多
无色无味的生活
3楼-- · 2018-12-31 00:12

Here's what I use (though I have them in the shortcut instead of the settings file):

eclipse.exe -showlocation -vm "C:\Java\jdk1.6.0_07\bin\javaw.exe" -vmargs -Xms256M -Xmx768M -XX:+UseParallelGC -XX:MaxPermSize=128M

查看更多
路过你的时光
4楼-- · 2018-12-31 00:14

Eclipse Galileo 3.5 and 3.5.1 settings

Currently (November 2009), I am testing with jdk6 update 17 the following configuration set of options (with Galileo -- eclipse 3.5.x, see below for 3.4 or above for Helios 3.6.x):
(of course, adapt the relative paths present in this eclipse.ini to the correct paths for your setup)

Note: for eclipse3.5, replace startup and launcher.library lines by:

-startup
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519

eclipse.ini 3.5.1

-data
../../workspace
-showlocation
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
384m
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-vm
../../../../program files/Java/jdk1.6.0_17/jre/bin/client/jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx384m
-Xss4m
-XX:PermSize=128m
-XX:MaxPermSize=384m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-Dcom.sun.management.jmxremote
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=C:/jv/eclipse/mydropins

See also my original answer above for more information.

Changes (from July 2009)

  • refers to the launcher and not the framework
  • shared plugins: org.eclipse.equinox.p2.reconciler.dropins.directory option.
  • Galileo supports fully relative paths for workspace or VM (avoid having to modify those from one eclipse installation to another, if, of course, your JVM and workspace stay the same)
    Before, those relative paths kept being rewritten into absolute ones when eclipse launched itself...
  • You also can copy the JRE directory of a Java JDK installation inside your eclipse directory

Caveats

There was a bug with ignored breakpoints actually related to the JDK.
Do use JDK6u16 or more recent for launching eclipse (You can then define as many JDKs you want to compile within eclipse: it is not because you launch an eclipse with JDK6 that you will have to compile with that same JDK).

Max

Note the usage of:

--launcher.XXMaxPermSize
384m
-vmargs
-XX:MaxPermSize=128m

As documented in the Eclipse Wiki,

Eclipse 3.3 supports a new argument to the launcher: --launcher.XXMaxPermSize.
If the VM being used is a Sun VM and there is not already a -XX:MaxPermSize= VM argument, then the launcher will automatically add -XX:MaxPermSize=256m to the list of VM arguments being used.
The 3.3 launcher is only capable of identifying Sun VMs on Windows.

As detailed in this entry:

Not all vms accept the -XX:MaxPermSize argument which is why it is passed in this manner. There may (or may not) exist problems with identifying sun vms.
Note: Eclipse 3.3.1 has a bug where the launcher cannot detect a Sun VM, and therefore does not use the correct PermGen size. It seems this may have been a known bug on Mac OS X for 3.3.0 as well.
If you are using either of these platform combination, add the -XX flag to the eclipse.ini as described above.

Notes:

  • the "384m" line translates to the "=384m" part of the VM argument, if the VM is case sensitive on the "m", then the so is this argument.
  • the "--launcher." prefix, this specifies that the argument is consumed by the launcher itself and was added to launcher specific arguments to avoid name collisions with application arguments. (Other examples are --launcher.library, --launcher.suppressErrors)

The -vmargs -XX:MaxPermSize=384m part is the argument passed directly to the VM, bypassing the launcher entirely and no check on the VM vendor is used.

查看更多
浅入江南
5楼-- · 2018-12-31 00:14

XX:+UseParallelGC that's the most awesome option ever!!!

查看更多
有味是清欢
6楼-- · 2018-12-31 00:16

Eclipse Ganymede 3.4.2 settings


For more recent settings, see Eclipse Galileo 3.5 settings above.


JDK

The best JVM setting always, in my opinion, includes the latest JDK you can find (so for now, jdk1.6.0_b07 up to b16, except b14 and b15)

eclipse.ini

Even with those pretty low memory settings, I can run large java projects (along with a web server) on my old (2002) desktop with 2Go RAM.

-showlocation
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-framework
plugins\org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
-vm
jdk1.6.0_10\jre\bin\client\jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx384m
-Xss2m
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-XX:CompileThreshold=5
-Dcom.sun.management.jmxremote

See GKelly's SO answer and Piotr Gabryanczyk's blog entry for more details about the new options.

Monitoring

You can also consider launching:

C:\[jdk1.6.0_0x path]\bin\jconsole.exe

As said in a previous question about memory consumption.

查看更多
还给你的自由
7楼-- · 2018-12-31 00:16

If youre like me and had problems with the current Oracle release of 1.6 then you might want to update your JDK or set

-XX:MaxPermSize
. More information is available here: http://java.dzone.com/articles/latest-java-update-fixes

查看更多
登录 后发表回答