gpt4 book ai didi

java - 升级失败时gc log的含义

转载 作者:行者123 更新时间:2023-12-02 09:39:43 26 4
gpt4 key购买 nike

发生promotion failure时出现以下gc日志是什么意思?

2019-07-24T23:58:32.113+0800: 1731400.358: [ParNew 
(0: promotion failure size = 3)
(1: promotion failure size = 2)
(2: promotion failure size = 2)
(3: promotion failure size = 2)
(4: promotion failure size = 3)
(6: promotion failure size = 2)
(7: promotion failure size = 65538)
(8: promotion failure size = 2)
(9: promotion failure size = 9)
(0: promotion failure size = 3)
(1: promotion failure size = 2)
(2: promotion failure size = 2)
(3: promotion failure size = 2)
(4: promotion failure size = 3)
(6: promotion failure size = 2)
(7: promotion failure size = 65538)
(8: promotion failure size = 2)
(9: promotion failure size = 9)
(0: promotion failure size = 3)
(1: promotion failure size = 2)
(2: promotion failure size = 2)
(3: promotion failure size = 2)
(4: promotion failure size = 3)
(6: promotion failure size = 2)
(7: promotion failure size = 65538)
(8: promotion failure size = 2)
(9: promotion failure size = 9)
(0: promotion failure size = 3)
(1: promotion failure size = 2)
(2: promotion failure size = 2)
(3: promotion failure size = 2)
(4: promotion failure size = 3)
(6: promotion failure size = 2)
(7: promotion failure size = 65538)
(8: promotion failure size = 2)
(9: promotion failure size = 9)
(0: promotion failure size = 3)
(1: promotion failure size = 2)
(2: promotion failure size = 2)
(3: promotion failure size = 2)
(4: promotion failure size = 3)
(6: promotion failure size = 2)
(7: promotion failure size = 65538)
(8: promotion failure size = 2)
(9: promotion failure size = 9)
(0: promotion failure size = 3)
(1: promotion failure size = 2)
(2: promotion failure size = 2)
(3: promotion failure size = 2)
(4: promotion failure size = 3)
(6: promotion failure size = 2)
(7: promotion failure size = 65538)
(8: promotion failure size = 2)
(9: promotion failure size = 9)
(0: promotion failure size = 3)

我使用parNew + CMS

JDK 1.8_102

最佳答案

提升失败是指垃圾收集在旧代中找不到足够的(连续)空间来将对象从新一代提升到其中时发生。

简单的解决方案是增加老年代堆大小。 This doc对你有帮助。

另一种解决方案,使用带 -XX:+UseG1GC 标志的 GC1 算法。因为在老年代碎片方面,G1 GCCMS更成功。 Oracle doc说:

The G1 GC reduces heap fragmentation by incremental parallel copying of live objects from one or more sets of regions (called Collection Set (CSet)) into different new region(s) to achieve compaction. The goal is to reclaim as much heap space as possible, starting with those regions that contain the most reclaimable space, while attempting to not exceed the pause time goal (garbage first).

关于java - 升级失败时gc log的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57195185/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com