Java Verbose GC流程 <af = allocation failure 意思是分派内存失败

Verbose GC alwayshappen after Allocation Failure.

I. Object Allocation:

1. less than 512 bytes (768 bytes on 64-bit platforms) or Larger objects are allocated from the cache if they can be contained in the existing cache -> Cache allocation

2. If not satisfied in the existing cache -> Heap lock allocation -> Attempted in SOA (Small Object Area) at first:

2.1 ifsatisfy, Enjoy your new object!

2.2 if no satisfy, but object size is less than 512 bytes -> Allocation Failure (AF)

2.3 if no satisfy, but object size is large than 512 bytes -> Attempted inLOA (Large Object Area):
2.3.1 if satisfy, Enjoy your new object!
2.3.2 if no satisfy, Allocation Failure ->Registers a GC cycle

II. GC cycle


1) STW (Stop The World)
2) Reclaim spaces of un-reachable objects
3) Marking -> Sweeping -> Compaction(optional, one condition: not enough free space is available to satisfy the allocation request)

Yes - 1. Successful object allocation
2. Possible Heap Shrinkage
NO - Heap Expansion Possible?
Yes  Expand heap (Continuous), allocate object
No???  OutOfMemoryError (OOM)

Verbose GC alwayshappen after Allocation Failure.

I. Object Allocation:

1. less than 512 bytes (768 bytes on 64-bit platforms) or Larger objects are allocated from the cache if they can be contained in the existing cache -> Cache allocation

2. If not satisfied in the existing cache -> Heap lock allocation -> Attempted in SOA (Small Object Area) at first:

2.1 ifsatisfy, Enjoy your new object!

2.2 if no satisfy, but object size is less than 512 bytes -> Allocation Failure (AF)

2.3 if no satisfy, but object size is large than 512 bytes -> Attempted inLOA (Large Object Area):
2.3.1 if satisfy, Enjoy your new object!
2.3.2 if no satisfy, Allocation Failure ->Registers a GC cycle

II. GC cycle


1) STW (Stop The World)
2) Reclaim spaces of un-reachable objects
3) Marking -> Sweeping -> Compaction(optional, one condition: not enough free space is available to satisfy the allocation request)

Yes - 1. Successful object allocation
2. Possible Heap Shrinkage
NO - Heap Expansion Possible?
Yes  Expand heap (Continuous), allocate object
No???  OutOfMemoryError (OOM)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值