Java Reference

http://what-when-how.com/Tutorial/topic-684cn3k/Java-Performance-The-Definitive-Guide-200.html

quently for G1 should be avoided. Check the size of the heap after a concurrent cycle, and

make sure that the InitiatingHeapOccupancyPercent value is set higher than that.

Tuning G1 mixed GC cycles

After a concurrent cycle, G1 cannot begin a new concurrent cycle until all previously marked

regions in the old generation have been collected. So another way to make G1 start a mark-

ing cycle earlier is to process more regions in a mixed GC cycle (so that there will end up be-

ing fewer mixed GC cycles).

The amount of work a mixed GC does is dependent on three factors. The first is how many

regions were found to be mostly garbage in the first place. There is no way to directly affect

that: a region is declared eligible for collection during a mixed GC if it is 35% garbage. (It is

likely this value will become a tunable parameter at some point; the experimental name for

the parameter (available in experiment builds of the open source code) is -

XX:G1MixedGCLiveThresholdPercent=N.)

The second factor is the maximum number of mixed GC cycles over which G1 will process

those regions, which is specified by the value of the flag -XX:G1MixedGCCountTarget=N.

The default value for that is 8; reducing that value can help overcome promotion failures (at

the expense of longer pause times during the mixed GC cycle).

On the other hand, if mixed GC pause times are too long, that value can be increased so that

less work is done during the mixed GC. Just be sure that increasing that number does not

delay the next G1 concurrent cycle too long, or a concurrent mode failure may result.

Finally, the third factor is the maximum desired length of a GC pause (i.e., the value speci-

fied by MaxGCPauseMillis). The number of mixed cycles specified by the G1MixedGCCoun-

tTarget flag is an upper bound; if time is available within the pause target, G1 will collect

more than one-eighth (or whatever value has been specified) of the marked old generation re-

gions. Increasing the value of the MaxGCPauseMillis flag allows more old generation re-

gions to be collected during each mixed GC, which in turn can allow G1 to begin the concur-

rent cycle sooner.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值