ParNew和CMS初始相关 [英] ParNew and CMS-Initial Correlation

查看:104
本文介绍了ParNew和CMS初始相关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我观察到,如果没有最近的ParNew,然后启动CMS-Initial-Mark阶段,则CMS-Initial-Mark阶段将花费较长时间来标记旧对象.

I have observed that when there is no recent ParNew and then if the CMS-Initial-Mark phase kicks-in, the CMS-Initial-Mark phase takes longer time to mark the objects in old generation.

大部分时间是我发现ParNew(可能是偶然的,或者JVM在内部执行此操作)的大部分时间是在CMS-Initial-Mark阶段之前发生的,然后在标记上一代相同数量的对象之前,CMS采取了时间更少.

The good part is most of the times I found ParNew (may be by chance or JVM does this internally) occurs just before CMS-Initial-Mark phase and then to mark the same number of objects in old generation, the CMS takes less time.

想知道这种观察背后的原因.

Would like to know the reasoning behind this observation.

注意:考虑到CMS初始标记阶段是世界末日,因此应尽最大努力缩短其持续时间.

Note: Considering, CMS-Initial-Mark phase is stop-the-world, the best attempt should be made to reduce its duration.

推荐答案

通常CMS初始标记会附加在年轻的收藏夹上. CMS可以等待年轻的收集一段时间(默认为2秒).如果没有发生,初始标记将使用单线程扫描所有年轻空间,这可能会非常耗时.

Normally CMS initial mark piggyback on young collection. CMS can wait for young collection for some time (2 seconds default). If it is not happening, initial mark will scan all young space using single thread, this could be very time consuming.

阅读 http://blog.ragozin .info/2011/06/understanding-gc-pauses-in-jvm-hotspots_02.html 了解更多详细信息.

Read http://blog.ragozin.info/2011/06/understanding-gc-pauses-in-jvm-hotspots_02.html for more details.

HotSpot选项–XX:CMSWaitDuration =< ms延迟"控制CMS初始标记可延迟多长时间携带新的收藏.

HotSpot option –XX:CMSWaitDuration=<delay in ms> controls how long CMS initial mark could be delayed to piggyback young collection.

这篇关于ParNew和CMS初始相关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆