当前位置:网站首页>Full GC (Ergonomics)排查分析
Full GC (Ergonomics)排查分析
2022-07-31 11:53:00 【南风知我意丿】
Full GC [Ergonomics]排查分析
问题描述
有一个线上Spark 任务频繁GC最后导致挂掉,下面是对它的排查分析
GC日志
{
Heap before GC invocations=4312 (full 121):
PSYoungGen total 673792K, used 648704K [0x00000000d5580000, 0x0000000100000000, 0x0000000100000000)
eden space 648704K, 100% used [0x00000000d5580000,0x00000000fcf00000,0x00000000fcf00000)
from space 25088K, 0% used [0x00000000fcf00000,0x00000000fcf00000,0x00000000fe780000)
to space 25088K, 0% used [0x00000000fe780000,0x00000000fe780000,0x0000000100000000)
ParOldGen total 1398272K, used 1398167K [0x0000000080000000, 0x00000000d5580000, 0x00000000d5580000)
object space 1398272K, 99% used [0x0000000080000000,0x00000000d5565cf0,0x00000000d5580000)
Metaspace used 133520K, capacity 143098K, committed 143508K, reserved 1175552K
class space used 16519K, capacity 17415K, committed 17596K, reserved 1048576K
2022-07-27T00:10:42.519+0800: 18668.196: [Full GC (Ergonomics) [PSYoungGen: 648704K->57867K(673792K)] [ParOldGen: 1398167K->1397781K(1398272K)] 2046871K->1455648K(2072064K), [Metaspace: 133520K->133520K(1175552K)], 0.6053255 secs] [Times: user=14.25 sys=0.02, real=0.61 secs]
Heap after GC invocations=4312 (full 121):
PSYoungGen total 673792K, used 57867K [0x00000000d5580000, 0x0000000100000000, 0x0000000100000000)
eden space 648704K, 8% used [0x00000000d5580000,0x00000000d8e02da0,0x00000000fcf00000)
from space 25088K, 0% used [0x00000000fcf00000,0x00000000fcf00000,0x00000000fe780000)
to space 25088K, 0% used [0x00000000fe780000,0x00000000fe780000,0x0000000100000000)
ParOldGen total 1398272K, used 1397781K [0x0000000080000000, 0x00000000d5580000, 0x00000000d5580000)
object space 1398272K, 99% used [0x0000000080000000,0x00000000d55054d0,0x00000000d5580000)
Metaspace used 133520K, capacity 143098K, committed 143508K, reserved 1175552K
class space used 16519K, capacity 17415K, committed 17596K, reserved 1048576K
}
{
Heap before GC invocations=4313 (full 122):
PSYoungGen total 673792K, used 648704K [0x00000000d5580000, 0x0000000100000000, 0x0000000100000000)
eden space 648704K, 100% used [0x00000000d5580000,0x00000000fcf00000,0x00000000fcf00000)
from space 25088K, 0% used [0x00000000fcf00000,0x00000000fcf00000,0x00000000fe780000)
to space 25088K, 0% used [0x00000000fe780000,0x00000000fe780000,0x0000000100000000)
ParOldGen total 1398272K, used 1397781K [0x0000000080000000, 0x00000000d5580000, 0x00000000d5580000)
object space 1398272K, 99% used [0x0000000080000000,0x00000000d55054d0,0x00000000d5580000)
Metaspace used 133520K, capacity 143098K, committed 143508K, reserved 1175552K
class space used 16519K, capacity 17415K, committed 17596K, reserved 1048576K
2022-07-27T00:10:48.605+0800: 18674.282: [Full GC (Ergonomics) [PSYoungGen: 648704K->56957K(673792K)] [ParOldGen: 1397781K->1398167K(1398272K)] 2046485K->1455125K(2072064K), [Metaspace: 133520K->133520K(1175552K)], 0.7382079 secs] [Times: user=18.29 sys=0.05, real=0.74 secs]
Heap after GC invocations=4313 (full 122):
PSYoungGen total 673792K, used 56957K [0x00000000d5580000, 0x0000000100000000, 0x0000000100000000)
eden space 648704K, 8% used [0x00000000d5580000,0x00000000d8d1f710,0x00000000fcf00000)
from space 25088K, 0% used [0x00000000fcf00000,0x00000000fcf00000,0x00000000fe780000)
to space 25088K, 0% used [0x00000000fe780000,0x00000000fe780000,0x0000000100000000)
ParOldGen total 1398272K, used 1398167K [0x0000000080000000, 0x00000000d5580000, 0x00000000d5580000)
object space 1398272K, 99% used [0x0000000080000000,0x00000000d5565df0,0x00000000d5580000)
Metaspace used 133520K, capacity 143098K, committed 143508K, reserved 1175552K
class space used 16519K, capacity 17415K, committed 17596K, reserved 1048576K
}
{
Heap before GC invocations=4314 (full 123):
PSYoungGen total 673792K, used 648704K [0x00000000d5580000, 0x0000000100000000, 0x0000000100000000)
eden space 648704K, 100% used [0x00000000d5580000,0x00000000fcf00000,0x00000000fcf00000)
from space 25088K, 0% used [0x00000000fcf00000,0x00000000fcf00000,0x00000000fe780000)
to space 25088K, 0% used [0x00000000fe780000,0x00000000fe780000,0x0000000100000000)
ParOldGen total 1398272K, used 1398167K [0x0000000080000000, 0x00000000d5580000, 0x00000000d5580000)
object space 1398272K, 99% used [0x0000000080000000,0x00000000d5565df0,0x00000000d5580000)
Metaspace used 133520K, capacity 143098K, committed 143508K, reserved 1175552K
class space used 16519K, capacity 17415K, committed 17596K, reserved 1048576K
2022-07-27T00:10:54.991+0800: 18680.667: [Full GC (Ergonomics) [PSYoungGen: 648704K->57325K(673792K)] [ParOldGen: 1398167K->1398090K(1398272K)] 2046871K->1455415K(2072064K), [Metaspace: 133520K->133520K(1175552K)], 0.6338603 secs] [Times: user=14.77 sys=0.02, real=0.64 secs]
Heap after GC invocations=4314 (full 123):
PSYoungGen total 673792K, used 57325K [0x00000000d5580000, 0x0000000100000000, 0x0000000100000000)
eden space 648704K, 8% used [0x00000000d5580000,0x00000000d8d7b600,0x00000000fcf00000)
from space 25088K, 0% used [0x00000000fcf00000,0x00000000fcf00000,0x00000000fe780000)
to space 25088K, 0% used [0x00000000fe780000,0x00000000fe780000,0x0000000100000000)
ParOldGen total 1398272K, used 1398090K [0x0000000080000000, 0x00000000d5580000, 0x00000000d5580000)
object space 1398272K, 99% used [0x0000000080000000,0x00000000d55528a0,0x00000000d5580000)
Metaspace used 133520K, capacity 143098K, committed 143508K, reserved 1175552K
class space used 16519K, capacity 17415K, committed 17596K, reserved 1048576K
}
在页面上搜Full GC 可以看到非常的频繁
原因分析:
jstat -gcutil < pid >
可以看到 youngGC 基本不变,Full GC一致飙升
GC日志
可以看到Full GC原因基本是 (Ergonomics)而且GC对老年代已经起不了作用了
2022-07-27T00:10:48.605+0800: 18674.282: [Full GC (Ergonomics) [PSYoungGen: 648704K->56957K(673792K)] [ParOldGen: 1397781K->1398167K(1398272K)] 2046485K->1455125K(2072064K), [Metaspace: 133520K->133520K(1175552K)], 0.7382079 secs] [Times: user=18.29 sys=0.05, real=0.74 secs]
查找资料,发现当使用 Server 模式下的ParallelGC 收集器组合(Parallel Scavenge + Serial Old)时,会在 Minor GC前进行一次判断,也就是 内存空间分配担保机制:
Eden 空间不足发生 Minor GC 之前,虚拟机先检查老年代最大可用的连续空间是否大于新生代所有对象总空间,如果条件成立的话,那么 Minor GC 可以确认是安全的。如果不成立的话虚拟机查看 HandlePromotionFailure 的值是否允许担保失败,如果HandlePromotionFailure 的值不允许冒险,那么就要进行一次 Full GC。如果允许则检查老年代最大可用的连续空间是否大于历次晋升到老年代对象的平均大小,如果大于将继续尝试进行 Minor GC,小于的话就要进行 Full GC以保证 Minor GC 的空间担保成功
这个 Java 服务没有通过启动参数配置垃圾收集器,查看堆配置发现是使用的默认 Parallel GC 。显然,合理的推测是空间分配担保失败导致了Full GC
jmap -heap < pid>
看到发现老年代的使用已经达到了 99.97697796737938%,只剩下了 0.03M,是可以和之前的推测相佐证的
PS Old Generation
capacity = 179306496 (171.0MB)
used = 179265216 (170.96063232421875MB)
free = 41280 (0.03936767578125MB)
99.97697796737938% used
jmap -histo < pid> | head -n 30
查看堆内存中占用内存最多的前 30 个类实例,发现可疑点
ExectionListenerBus
一直增加,导致堆内存一直被占用得不到释放
解决方案:
查了spark 的github看到有人提了PR,得知是spark框架的bug,本次bug在spark3.0.3已经修复
边栏推荐
- Different lower_case_table_names settings for server ('1') and data dictionary ('0') solution
- DCM middleware family welcomes a new member
- mpu9150(driverack pa简明教程)
- keras自带数据集(横线生成器)
- Shengxin Weekly Issue 38
- vb.net 画曲线
- B/S架构模式的一个整体执行流程
- mysql automatically adds creation time and update time
- Docker installs canal and mysql for simple testing and achieves cache consistency between redis and mysql
- 初识QEMU
猜你喜欢
Shengxin Weekly Issue 38
Mysql环境变量的配置(详细图解)
LeetCode 1161.最大层内元素和:层序遍历
IDEA 配置方法注释自动参数
ApiPost 真香真强大,是时候丢掉 Postman、Swagger 了
Distributed Transactions - Introduction to Distributed Transactions, Distributed Transaction Framework Seata (AT Mode, Tcc Mode, Tcc Vs AT), Distributed Transactions - MQ
矩形脉冲波形的占空比及脉冲和瞬态特征的测量
apisix-Getting Started
Different lower_case_table_names settings for server ('1') and data dictionary ('0') solution
Acwing第 62 场周赛【未完结】
随机推荐
CameraToolUnity中两种摄像机的两种观察控制方式
LeetCode 1161.最大层内元素和:层序遍历
蓝牙协议栈开发板 STM32F1 跑蓝牙协议栈 –传统蓝牙搜索演示以及实现原理[通俗易懂]
音视频基础
下课看着文档走回实验室,我重新拾起了遗忘的SQL运算符
JVS开发套件产品定位
瑞吉外卖项目:新增菜品与菜品分页查询
lotus-local-net 2k v1.17.0-rc4
数据湖(十九):SQL API 读取Kafka数据实时写入Iceberg表
JVS应用中心
ApiPost 真香真强大,是时候丢掉 Postman、Swagger 了
LeetCode - 025. 链表中的两数相加
分布式事务Seata详细使用教程
Different lower_case_table_names settings for server (‘1‘) and data dictionary (‘0‘) 解决方案
MySQL日志中“binlog”的三种格式玩起来真爽
最全phpmyadmin漏洞汇总
If the value of the enum map does not exist, deserialization is not performed
给你一个大厂面试的机会,你能面试上吗?进来看看!
Distributed id solution
Different lower_case_table_names settings for server ('1') and data dictionary ('0') solution