您为运行Eclipse找到的最佳JVM设置是什么?
当前回答
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”的限制。
这些标志的主要优化目标是在所有情况下最小化延迟,次要优化目标是最小化内存使用。
其他回答
下面是我自己在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
-showlocation
为了让eclipse更容易运行两次,并知道您正在处理哪个工作区
Eclipse 3.6添加了一个首选项选项来指定要显示的工作区名称(显示在窗口标题中),这比-showlocation好用得多,原因有三:
不需要重新启动eclipse即可使其生效。 你可以选择一个短代码。 它出现在透视图和应用程序名称之前。
Eclipse Galileo 3.5和3.5.1设置
目前(2009年11月),我正在用jdk6更新17测试以下配置选项集(使用Galileo—eclipse 3.5)。3.4或以上版本的helios3.6.x,请参见下文): (当然,将eclipse.ini中的相对路径调整为正确的设置路径)
注意:对于eclipse3.5,替换startup和launcher。图书馆行:
-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
更多信息请参见上面我的原始答案。
变更(2009年7月起)
指的是启动器而不是框架 共享插件:org.eclipse.equinox.p2.reconciler.dropins。目录选项。 Galileo完全支持工作空间或VM的相对路径(当然,如果您的JVM和工作空间保持不变,则可以避免从一个eclipse安装到另一个eclipse安装时修改它们) 在此之前,当eclipse启动时,这些相对路径一直被重写为绝对路径…… 您还可以将Java JDK安装的JRE目录复制到eclipse目录中
警告
有一个被忽略的错误,实际上与JDK有关。 一定要使用JDK6u16或更新的版本来启动eclipse(然后可以在eclipse中定义任意数量的JDK来编译:并不是因为使用JDK6启动eclipse就必须使用相同的JDK来编译)。
Max
注意用法:
--launcher.XXMaxPermSize
384m
-vmargs
-XX:MaxPermSize=128m
正如Eclipse Wiki中所记录的那样,
Eclipse 3.3支持启动器的一个新参数:——launcher. xxmaxpermsize。 如果正在使用的VM是Sun VM,并且还没有-XX:MaxPermSize= VM参数,那么启动器将自动将-XX:MaxPermSize=256m添加到正在使用的VM参数列表中。 3.3启动器只能识别Windows上的Sun虚拟机。
如本条目所述:
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.
我自己的设置(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
以下是我使用的方法(尽管我在快捷方式而不是设置文件中使用了它们):
eclipse.exe -showlocation -vm "C:\Java\jdk1.6.0_07\bin\javaw.exe" -vmargs -Xms256M -Xmx768M -XX:+UseParallelGC -XX:MaxPermSize=128M
推荐文章
- 如何在清洁模式下运行eclipse ?如果我们这样做会发生什么?
- 如何在Eclipse中更改动态web项目的上下文根?
- Eclipse错误:间接引用所需的.class文件?
- 如何在Eclipse中只使用键盘去一个错误?
- 如何在Eclipse中生成Javadoc注释?
- 如何在EPF Composer 1.5中删除一个规程?
- Eclipse调试器总是阻塞在ThreadPoolExecutor上,没有任何明显的异常,为什么?
- 是什么原因导致Eclipse中导入的Maven项目默认使用Java 1.5而不是Java 1.6,我如何确保它不使用?
- 如何从Eclipse设置java.library.path
- 如何使Eclipse/EGit在更新后识别现有的存储库信息?
- 为什么每当我创建一个新项目时,Eclipse都会自动添加appcompat v7库支持?
- 如何在Eclipse CDT中启用c++ 11/ c++ 0x支持?
- Eclipse错误:“创建Java虚拟机失败”
- 是否有Eclipse行宽标记?
- Eclipse -“正在使用或无法创建的工作区,请选择另一个。”