Java GC升级失败

时间:2014-04-15 16:18:02

标签: java garbage-collection

我有一个16G的堆大小,Java 6u43上的Young Gen = 4G和Old Gen = 12G。我看到以下促销失败。

有趣的是,在失败发生之前,旧的大小从12G下降到9G,年轻的gen从3.4G下降到0.3。但仍然晋升失败。

我的CMSIntitiatingOccupancyFraction = 75%且CMSInitiatingOccupancyOnly = true。任何帮助将不胜感激

2014-04-15T06:11:37.275-0400: 200306.377: [GC 200306.377: [ParNew
Desired survivor size 214728704 bytes, new threshold 15 (max 15)
  58106 - age   1:      27984 bytes,      27984 total
  58107 - age   2:  111513120 bytes,  111541104 total
  58108 - age   3:   28811760 bytes,  140352864 total
  58109 - age   4:   32949056 bytes,  173301920 total
  58110 : 266825K->240137K(3774912K), 0.0547210 secs] 9338952K->9312265K(16357824K), 0.0551270 secs] [Times: user=0.95 sys=0.00, real=0.05 secs]
  58111 2014-04-15T06:11:49.838-0400: 200318.940: [GC 200318.940: [ParNew
  58112 Desired survivor size 214728704 bytes, new threshold 3 (max 15)
  58113 - age   1:  136690632 bytes,  136690632 total
  58114 - age   2:       1768 bytes,  136692400 total
  58115 - age   3:  110476248 bytes,  247168648 total
  58116 - age   4:   26402960 bytes,  273571608 total
  58117 - age   5:   33863440 bytes,  307435048 total

[Times: user=1.69 sys=0.00, real=0.10 secs]
  58119 2014-04-15T06:11:57.424-0400: 200326.526: [GC 200326.526: [ParNew (0: promotion failure size = 6)  (1: promotion failure size = 6)  (2: promotion failure size = 6)  (3: promotion failure size = 6)  (        4: promotion failure size = 6)  (5: promotion failure size = 6)  (6: promotion failure size = 6)  (7: promotion failure size = 6)  (8: promotion failure size = 12)  (9: promotion failure size = 6)  (        10: promotion failure size = 6)  (11: promotion failure size = 6)  (12: promotion failure size = 6)  (13: promotion failure size = 6)  (14: promotion failure size = 12)  (15: promotion failure size =         6)  (16: promotion failure size = 12)  (17: promotion failure size = 6)  (promotion failed)

1 个答案:

答案 0 :(得分:1)

CMS在旧代收集时不会对堆进行任何碎片。所以,你可能有足够的可用空间,但它不是连续的,因此失败了。

我认为在此之后您将获得一个长的完整GC调用,这将导致整个终身空间的长期停止世界事件; GC做碎片。

编辑您可以尝试减少年轻的基因大小并增加旧的基因大小,或者您可以尝试G1收集器,它会在每一步中压缩堆(尽管不完全)。

相关问题