您为运行Eclipse找到的最佳JVM设置是什么?


当前回答

如果您使用的是Linux + Sun JDK/JRE 32位,请将“-vm”更改为:

-vm 
[your_jdk_folder]/jre/lib/i386/client/libjvm.so

如果您使用的是Linux + Sun JDK/JRE 64位,请将“-vm”更改为:

-vm
[your_jdk_folder]/jre/lib/amd64/server/libjvm.so

这在Ubuntu 8.10和9.04上运行得很好

其他回答

下面是我自己在i7 2630M 16GB内存笔记本电脑上运行Eclipse的设置,这个设置已经使用了一周,没有一次崩溃,Eclipse 3.7运行平稳。

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms1024m
-Xmx4096m 
-XX:MaxPermSize=256m

计算: 适用于win7 x64

Xms =物理内存/ 16 Xmx =物理内存/ 4 MaxPermSize =保持默认值256m

-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.1.100.v20110502
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms128m
-Xmx512m
-XX:MaxPermSize=256m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Dcom.sun.management.jmxremote
-Declipse.p2.unsignedPolicy=allow

这些设置对我来说就像一个魅力。我正在运行OS X10.6, Eclipse 3.7 Indigo, JDK1.6.0_24

如果您要使用jdk6更新14,我建议使用G1垃圾收集器,这似乎有助于提高性能。

要做到这一点,删除这些设置:

- xx: + UseConcMarkSweepGC - xx: + CMSIncrementalMode - xx: + CMSIncrementalPacing

然后用这些替换它们:

-XX:+解锁实验性VMOptions -XX:+使用G1GC

以下是我使用的方法(尽管我在快捷方式而不是设置文件中使用了它们):

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

我自己的设置(Java 1.7,修改为1.6):

-vm
C:/Program Files (x86)/Java/jdk1.7.0/bin
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20100628
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-server
-Dosgi.requiredJavaVersion=1.7
-Xmn100m
-Xss1m
-XgcPrio:deterministic
-XpauseTarget:20
-XX:PermSize=400M
-XX:MaxPermSize=500M
-XX:CompileThreshold=10
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UnlockExperimentalVMOptions
-XX:+DoEscapeAnalysis
-XX:+UseG1GC
-XX:+UseFastAccessorMethods
-XX:+AggressiveOpts
-Xms512m
-Xmx512m