java的有意思的_发现一个有意思的项目banana

大内存CMS还是会stop the world很长时间,比如超过20GB的内存,因此HBase建议单个JVM别超过15GB的内存。

其实我觉得如果能不stop the world,compaction时间长一点倒无所谓。因为碎片肯定会出现,要避免碎片出现,程序可以自己做一些优化,比如学习HBase。

根据实际经验,内存大了对象多了,stop the world就很长

Phases

Once the GC is triggered, the CMS algorithm consists of a series of phases run in sequence.

Initial Mark - Pauses all application threads and marks all objects directly reachable from root objects as live. This phase stops the world.

Concurrent Mark - Application threads are restarted. All live objects are transitively marked as reachable by following references from the objects marked in the initial mark.

Concurrent Preclean - This phase looks at objects which have been updated or promoted during the concurrent mark or new objects that have been allocated during the concurrent mark. It updates the mark bit to denote whether these objects are live or dead. This phase may be run repeatedly until there is a specified occupancy ratio in Eden.

Remark Since some objects may have been updated during the preclean phase its still necessary to do stop the world in order to process the residual objects. This phase does a retrace from the roots. It also processes reference objects, such as soft and weak references. This phase stops the world.

Concurrent Sweep - This looks through the Ordinary Object Pointer (OOP) Table, which references all objects in the heap, and finds the dead objects. It then re-adds the memory allocated to those objects to its freelist. This is the list of spaces from which an object can be allocated.

Concurrent Reset - Reset all internal data structures in order to be able to run CMS again in future.

【 在 Apache9 的大作中提到: 】

: CMS已经能做到大部分时候不stop the world,但问题是,简单的mark sweep时间长了之后碎片会很严重的,到一定阶段不得不做一次compaction,这个就死慢了。。。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值