Eclipse的JVM最优设置

为了找到Eclipse JVM的最优设置,我反复研究了sun工程师的演说与资料并经过了反复试验,以下是我找到的最优设置:[b]-vmargs -XX:+UseParallelGC[/b] ,我的系统环境是双核+Windows+JDK5.0+Eclipse。

以上参数在命令行下启动Eclipse也是可用的。接下来我们讨论一下 JDK5.0 中垃圾回收器的"ergonomics"特性,这个特性可以使JVM实现自动控制。这个特性仅仅在使用UseParallelGC collector (也被称为parallel scavenge collector)的时候会被激活。注意使用该特性的时候无需通过-XmxNNNm 来设置堆空间。根据相关的资料,任何其他的参数设置都会使 JVM 无法实现自动控制。因为只要我们设置了其他参数,JVM就会使用我们的参数设置而忽略自身的"ergonomics"特性(JVM以为我们更了解其内在的机制,其实不然)。


如何想查看垃圾回收器的日志信息,我们可以使用以下的参数(不要换行)设置将日志信息输出到指定的文件中:

[b]-vmargs -Xloggc:c:tempe.txt -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -verbose:gc -XX:+UseParallelGC [/b]

参考链接:
JVM参数设置大全
[url]http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp[/url]

JVM参数设置大全压缩版
[url]http://blogs.sun.com/watt/resource/jvm-options-list.html[/url]


原文:
In my neverending quest to find the best JVM settings for running Eclipse I've been pouring over talks and papers given by Sun engineers and trying different things. Here are the best options that I've found so far for my 2-processor Windows machine running JDK5.0 and Eclipse3.1:

-vmargs -XX:+UseParallelGC

These go on the Eclipse executable's command line. What I'm doing here is taking advantage of the JDK5.0 garbage collection "ergonomics" feature to let the JVM self tune. It's only active with the UseParallelGC collector (also called the parallel scavenge collector). Note there is no -XmxNNNm option to set the heap size. According to the doc, any sizing or tweaking options will disable self tuning because it figures we know better than it does (it doesn't know us very well does it?).

If you want to see what the garbage collector is doing you could add more printing options like this (all on one line) to dump some logging information to a file that you can view or process later:

-vmargs -Xloggc:c:tempe.txt -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
-XX:+PrintTenuringDistribution -verbose:gc -XX:+UseParallelGC

原文链接:[url]http://www.eclipsezone.com/eclipse/forums/t20732.html[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值