gpt4 book ai didi

garbage-collection - 有人能解释一下 CMS 垃圾回收的 "Concurrent Abortable Preclean"阶段发生了什么吗?

转载 作者:行者123 更新时间:2023-12-04 07:55:23 25 4
gpt4 key购买 nike

我经历了https://plumbr.eu/handbook/garbage-collection-algorithms-implementations/concurrent-mark-and-sweep解释 CMS GC 的链接,但无法理解 Concurrent Abortable Preclean 在做什么,如果有人详细解释它会有所帮助。

最佳答案

博文Understanding CMS GC Logs提到(不可中止的)预清理阶段的目的:

Precleaning is also a concurrent phase. Here in this phase we look at the objects in CMS heap which got updated by promotions from young generation or new allocations or got updated by mutators while we were doing the concurrent marking in the previous concurrent marking phase. By rescanning those objects concurrently, the precleaning phase helps reduce the work in the next stop-the-world “remark” phase.

所以那个阶段是一个优化。

然后可中止的预清理被描述为

After 'concurrent preclean' if the Eden occupancy is above CMSScheduleRemarkEdenSizeThreshold, we start 'concurrent abortable preclean' and continue precleanig until we have CMSScheduleRemarkEdenPenetration percentage occupancy in eden, otherwise we schedule 'remark' phase immediately.

另一个帖子 The Unspoken - CMS and PrintGCDetails进一步提到:

The remark phase is scheduled so that it does not occur back-to-back with a ParNew so as not to appear to be a pause that is the sum of the ParNew and the remark pause. A second precleaning phase is started and is aborted when the remark phase is ready to start. Aborting this second precleaning phase is the expected behavior. That it was aborted is not an indication of an error. Since the remark phase is waiting, why not preclean but don't delay the remark for the sake of precleaning.

换句话说,abortable preclean 是一种优化(preclean 优化),用于在年轻的集合之间间隔 remark 暂停,并以有用的方式度过等待时间。

关于garbage-collection - 有人能解释一下 CMS 垃圾回收的 "Concurrent Abortable Preclean"阶段发生了什么吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44182733/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com