Fragmentation and UseCMSInitiatingOccupancyOnly

Gustav Åkesson gustav.r.akesson at gmail.com
Wed Jan 22 11:37:29 PST 2014


Hi,

Not sure I understand the answer - in case the flag is disabled, is little contiguous free space (i.e. fragmentation) in oldgen a variable which could trigger CMS prior to the set occupancy fraction? I.e. is CMS smart enough to take into account the possibility of of clearing out dead objects (thus, reducing fragmentation) before hitting a promotion failure. And if you set UseCMSInitiatingOccupancyOnly then you remove this feature from CMS?

The reason I'm asking is that I got a couple of FullGCs due to promotion failure when setting UseCMSInitiatingOccupancyOnly, which did not occur when the flag was disabled. And  this was on a 512mb heap with occupancy fraction 80% and only 20mb live data.


Best Regards,

Gustav Åkesson


22 jan 2014 kl. 12:37 skrev Bernd Eckenfels <bernd-2014 at eckenfels.net>:

> If You set the percentage low, the Risk is, that oldgen will be permanently over the threshold (this might be wanted?). If you set it high, then AF might happen due to fragmentation or background collection beeing too slow.
> 
> I think fragmentation is not honored, therefore your desired oldheap size should account for that an have plenty of (untouched) headroom.
> 
> Bernd
> 
>> Am 22.01.2014 um 12:12 schrieb Gustav Åkesson <gustav.r.akesson at gmail.com>:
>> 
>> Hi,
>> 
>> In case UseCMSInitiatingOccupancyOnly is enabled we instruct CMS to start at X% of old gen, and not try to figure out by itself when to start. My understanding is that when flag is disabled, CMS is aiming for X%, but uses statistics of previous collections (GC rate, GC time) to determine when to initiate.
>> 
>> My question is whether enabling UseCMSInitiatingOccupancyOnly increases the risk of promotion failure (FullGC) due to fragmentation, meaning that it will always honor X% rule and rather generate promotion failure event than run CMS prematurely?
>> 
>> Or, in case flag is disabled, is CMS smart enough to start prior to X% when heap is fragmented instead of generating promotion failure?
>> 
>> 
>> Best Regards,
>> 
>> Gustav Åkesson
>> _______________________________________________
>> hotspot-gc-use mailing list
>> hotspot-gc-use at openjdk.java.net
>> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use



More information about the hotspot-gc-use mailing list