Reddit 上关于 Azul's Pauseless Garbage Collector 的讨论

(artima 原文 , reddit 上的讨论 )

 

托管环境日益流行, 作为托管中重要环节的 GC, 对性能有比较大的影响, 所以对 GC 机制的一定了解, 还是有必要的.

原文讨论了他们公司实现 Pauseless GC 的思路, 在 reddit 的讨论中也有一些很精彩的评论, 在此摘抄部分.

 

rayiner@reddit

"There is no such thing as "pauseless" memory management. All memory management systems have pauses, the real question is what is the distribution, length, and character of the pauses on various allocation loans?

malloc() has relatively long pauses on allocation and symmetric pauses on frees. However, generally the pauses are of predictable length (though by no means bounded, at all, because you can hit pathological cases scanning free-lists).

A copying generational GC has a very short pause on allocating objects (however long it takes to bump a pointer) and no pause on freeing objects (the tracer never visits dead objects), but potentially long pauses when objects stay alive between collections.

There are a lot of loads where all the pauses involved in malloc() add up to more than what you'll see with a generational GC. On most functional code where there is a lot of temporary state but very little long-term state, a GC will do very little work copying live data at each collection, while a malloc() implementation will have to muck with an increasingly more fragmented free-list for each malloc()/free(). On the flip side, on imperative code where you have a ton of long-lived state, a GC will do a lot of work copying live objects on each collection, while a malloc() implementation will do nothing if objects are just sitting around."

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值