Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why promotion failure and concurrent mode failure?

GC setting is :

# Min, max, total JVM size (-Xms -Xmx)
JVM_SIZE="-Xms48g -Xmx48g"

# New Generation Sizes (-XX:NewSize -XX:MaxNewSize)
JVM_SIZE_NEW="-XX:NewSize=8192m -XX:MaxNewSize=8192m"

# Type of Garbage Collector to use
JVM_GC_TYPE="-XX:+UseConcMarkSweepGC -XX:+UseParNewGC"

# Tuning options for the above garbage collector
JVM_GC_OPTS="-XX:CMSInitiatingOccupancyFraction=75 -XX:SurvivorRatio=30 -XX:+CMSParallelRemarkEnabled -XX:+CMSScavengeBeforeRemark"

GC log:

2014-02-28T23:57:44.267+0800: 1427589.638: [GC 1427589.638: [ParNew (0: promotion failure size = 2315)  (1: promotion failure size = 2314)  (2: promotion failure size = 1027)  (3: promotion failure size = 4)  (4: promotion failure size = 2310)  (5: promotion failure size = 4)  (6: promotion failure size = 1027)  (7: promotion failure size = 4)  (8: promotion failure size = 4)  (9: promotion failure size = 4)  (**promotion failed**)
Desired survivor size 134217728 bytes, new threshold 1 (max 15)
- age   1:  268435048 bytes,  268435048 total
: 8126464K->8126464K(8126464K), 529.2651060 secs]1428118.904: [CMS2014-03-01T00:06:40.620+0800: 1428125.992: [CMS-concurrent-mark: 32.592/602.493 secs] [Times: user=1196.12 sys=108.73, real=602.40 secs]
 (**concurrent mode failure**): **38068955K->3758792K(41943040K)**, 27.0563910 secs] 45944487K->3758792K(50069504K), [CMS Perm : 60159K->59831K(83968K)], 556.3220190 secs] [Times: user=754.14 sys=57.00, real=556.23 secs]

CMSInitiatingOccupancyFraction is 75, but it seems CMS gc is invoked too late. Why?

Tenure size should be 48g - 8g = 40g, while 75% of 40g should be 30G but the log shows 38068955K->3758792K(41943040K)

like image 469
yozhao Avatar asked Mar 03 '14 14:03

yozhao


1 Answers

promotion failure is caused by fragmentation of free space, it is not directly related to CMSInitiatingOccupancyFraction

-XX:CMSInitiatingOccupancyFraction set threshold only for first collection, after that JVM will adjust factor unless -XX:+UseCMSInitiatingOccupancyOnly is specified.

See more about configuring CMS for large heaps and JVM GC options.

like image 135
Alexey Ragozin Avatar answered Oct 04 '22 09:10

Alexey Ragozin