您为运行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上运行得很好
其他回答
我自己的设置(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
-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.
Eclipse Ganymede 3.4.2设置
有关最新的设置,请参阅上面的Eclipse Galileo 3.5设置。
JDK
在我看来,最好的JVM设置总是包括你能找到的最新JDK(所以目前为止,jdk1.6.0_b07到b16,除了b14和b15)
eclipse.ini
即使有这么低的内存设置,我也可以用2Go RAM在我2002年的旧台式机上运行大型java项目(以及web服务器)。
-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
请看GKelly的SO回答和Piotr Gabryanczyk的博客文章,了解更多关于新选项的细节。
监控
你也可以考虑发布:
C:\[jdk1.6.0_0x path]\bin\jconsole.exe
正如之前关于内存消耗的问题所述。
以下是我使用的方法(尽管我在快捷方式而不是设置文件中使用了它们):
eclipse.exe -showlocation -vm "C:\Java\jdk1.6.0_07\bin\javaw.exe" -vmargs -Xms256M -Xmx768M -XX:+UseParallelGC -XX:MaxPermSize=128M
推荐文章
- 访问限制:'Application'类型不是API(必需库rt.jar的限制)
- Android Eclipse -无法找到*.apk
- 通过SSH使用Eclipse完成远程项目
- javac和Eclipse编译器之间的区别是什么?
- 如何在清洁模式下运行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库支持?