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


当前回答

-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

其他回答

-showlocation

为了让eclipse更容易运行两次,并知道您正在处理哪个工作区

Eclipse 3.6添加了一个首选项选项来指定要显示的工作区名称(显示在窗口标题中),这比-showlocation好用得多,原因有三:

不需要重新启动eclipse即可使其生效。 你可以选择一个短代码。 它出现在透视图和应用程序名称之前。

下面是我自己在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

如果您使用的是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上运行得很好

-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

Eclipse Indigo 3.7.2设置(64位linux)

在x86-64 Linux上运行的Sun/Oracle java版本“1.6.0_31”和Eclipse 3.7的设置:

-nosplash
-vmargs
-Xincgc
-Xss500k
-Dosgi.requiredJavaVersion=1.6
-Xms64m
-Xmx200m
-XX:NewSize=8m
-XX:PermSize=80m
-XX:MaxPermSize=150m
-XX:MaxPermHeapExpansion=10m
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=70
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+UseParNewGC
-XX:+CMSConcurrentMTEnabled
-XX:ConcGCThreads=2
-XX:ParallelGCThreads=2
-XX:+CMSIncrementalPacing
-XX:CMSIncrementalDutyCycleMin=0
-XX:CMSIncrementalDutyCycle=5
-XX:GCTimeRatio=49
-XX:MaxGCPauseMillis=20
-XX:GCPauseIntervalMillis=1000
-XX:+UseCMSCompactAtFullCollection
-XX:+CMSClassUnloadingEnabled
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+AggressiveOpts
-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses

注意,这仅为堆使用了200 MB,非堆使用了150 MB。如果你在使用 对于巨大的插件,你可能想增加“-Xmx200m”和“-XX:MaxPermSize=150m”的限制。

这些标志的主要优化目标是在所有情况下最小化延迟,次要优化目标是最小化内存使用。