简体   繁体   中英

Minor GC happening when Eden is not full. What would be the cause of Minor GC when Eden is not full?

I am using the CMS collector.

I am seeing minor GCs through the GC logs. But I see minor GCs happening when the Eden is not 100% full. Can this happen ? Is there any argument/config that could avoid this and make use of 100% Eden.?

Your survivor ratio is 5 and you have two survivor spaces. Your Eden space is 5/(5+1+1) or 9.28 GB and it looks like you are using more than this. It appears your survivor space is too low. I suggest you increase it to 10 or 20 and you will have a larger Eden space.

Eden being full, doesn't really mean everything up to the last byte occupied.

If you look at your GC logs, the first collection shows for Young generation
9857949K->177992K(11684160K) .

This means that Young generation had 9'857'949 kB occupied out of total 11'684'160 kB available ( 84.4% ).

Subsequently we see 9914824K->139689K(11684160K) which is 84.8% and finally 9876521K->115958K(11684160K) which is 84.5% .

That young generation therefore looks full enough for me. Given the new object creation speed, available Survivor1 and Survivor2 spaces and number of other factors it is entirely possible that 84% is full enough to start acting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM