ParNew 和 Parallel Old

本文探讨了Java垃圾回收器中ParNew与ParallelOld为何无法直接配合使用的技术原因。ParNew采用特定接口风格实现年轻代清理,而ParallelOld不遵循此风格,导致两者难以匹配。最终目标是使ParallelScavenge仅与ParallelOld搭配,并清理其他特例代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


在学习java垃圾收集器的时候,遇到一个困惑,看下图,为什么没有新生代选择ParNew,老年代使用Parallel Old的选择?

这里写图片描述


最后在Our Collectors博客找到答案

ParNew is written in a style where each generation being collected offers certain interfaces for its collection.

For example, ParNew (and Serial) implements space_iterate() which will apply an operation to every object in the young generation. Alternatively, Parallel Scavenge (at least with its initial implementation before Parallel Old) always knew how the tenured generation was being collected and could call directly into the code in the Serial Old” collector.

Parallel Old is not written in the ParNew style so matching it with ParNew doesn’t just happen without significant work. By the way, we would like to match Parallel Scavenge only with Parallel Old eventually and clean up any of the ad hoc code needed for “Parallel Scavenge” to work with both.

主要是说:Parallel Old 和 ParNew 不能够相互匹配工作

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值