【问题标题】:what memory settings should I use for eclipse on this system?我应该在这个系统上为 eclipse 使用什么内存设置?
【发布时间】:2012-07-26 06:04:23
【问题描述】:

我需要在 eclipse 中运行我的程序,我希望通过增加 eclipse 的内存大小来加快这个过程,但我对使用哪些设置感到困惑。

这是我的系统:

  Model Name:   MacBook Air
  Model Identifier: MacBookAir3,2
  Processor Name:   Intel Core 2 Duo
  Processor Speed:  1.86 GHz
  Number of Processors: 1
  Total Number of Cores:    2
  L2 Cache: 6 MB
  Memory:   4 GB
  Bus Speed:    1.07 GHz

这是我当前的 eclipse .ini:

-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.1.101.v20120109-1504
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=512m
-Xms1536m
-Xmx1536m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

我应该在 XX、Xms 和 Xmx 使用什么?

谢谢

【问题讨论】:

    标签: java eclipse performance memory jvm


    【解决方案1】:

    这些内存设置用于运行 Eclipse IDE,不一定是您正在编写的程序。

    为此,您可以在程序的运行配置中设置特定的 -Xms 和 -Xmx 值。

    至于价值……它完全取决于你的程序,所以没有“一刀切”。

    关于 Eclipse 参数,您的 Xmx 可能没问题,但我会将 Xms 降低很多,到 256m 左右。

    Xms 基本上是程序运行时分配的起始内存大小,Xmx 是最大值。从 1.5gigs 开始似乎有点过分。

    【讨论】:

      【解决方案2】:

      使用那些

      -server -Xms3g -Xmx3g -Xmn1g -XX:MaxPermSize=256M -XX:ReservedCodeCacheSize=256m - XX:ThreadStackSize=2048 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseFastAccessorMethods -XX:CMSInitiatingOccupancyFraction=85 -XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:+UseNUMA -XX:-UseBiasedLocking -XX:+UseTLAB -XX:+DoEscapeAnalysis -XX:+UseCompressedOops -XX:+TieredCompilation -XX:+OptimizeStringConcat -XX:+AlwaysPreTouch

      就是这样)

      【讨论】:

      • 认真的吗?他在 4g 机器上运行,你建议他用 3g Xms 启动 Eclipse?...除非你没有在该机器上运行任何其他东西,否则效果不会很好。
      • 你是对的 - 那么这些选项应该更好的性能 -Xms1g -Xmx1g -Xmn256m -XX:MaxPermSize=256M -XX:ReservedCodeCacheSize=256m - XX:ThreadStackSize=2048 -XX:+HeapDumpOnOutOfMemoryError - XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseFastAccessorMethods -XX:CMSInitiatingOccupancyFraction=85 -XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:+UseNUMA -XX:-UseBiasedLocking -XX:+UseTLAB -XX:+DoEscapeAnalysis -XX:+UseCompressedOops -XX:+TieredCompilation -XX:+OptimizeStringConcat -XX:+AlwaysPreTouch
      猜你喜欢
      • 2017-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-30
      • 1970-01-01
      • 2011-09-12
      相关资源
      最近更新 更多