当前位置:网站首页>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已经修复
边栏推荐
- kubernetes之服务发现
- Use Excel to read data exposed by SAP ABAP CDS View through ODBC
- Threading(in thread main)
- 生命不息,刷题不止,简单题学习知识点
- MySQL limit paging query and performance issues
- 安装MYSQL遇到问题:write configuration file卡主
- 初识QEMU
- deeplab implements its own remote sensing geological segmentation dataset
- 基于C51实现按键控制
- 使用 Excel 读取 SAP ABAP CDS View 通过 ODBC 暴露出来的数据
猜你喜欢

The most complete phpmyadmin vulnerability summary

一文吃透接口调用神器RestTemplate

台达PLC出现通信错误或通信超时或下载时提示机种不符的解决办法总结

无法将“node.exe”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。

Experience innovation and iteration through the development of lucky draw mini-programs

Different lower_case_table_names settings for server (‘1‘) and data dictionary (‘0‘) 解决方案

MySQL row-level locks (row locks, adjacent key locks, gap locks)

JVS设置不同应用的登录时效时间

St. Regis Takeaway Project: New dishes and dishes paged query

5 open source Rust web development frameworks, which one do you choose?
随机推荐
下课看着文档走回实验室,我重新拾起了遗忘的SQL运算符
file contains vulnerabilities
musl Reference Manual
ApiPost 真香真强大,是时候丢掉 Postman、Swagger 了
mysql 索引使用与优化
MySQL limit paging query and performance issues
Experience innovation and iteration through the development of lucky draw mini-programs
In Excel using ODBC consumer SAP ABAP CDS view
IDEA 配置方法注释自动参数
vb.net 画曲线
SAP Commerce Cloud Product Review 的添加逻辑
矩形脉冲波形的占空比及脉冲和瞬态特征的测量
keras自带数据集(横线生成器)
JVS低代码能力简介及功能清单
MySQL模糊查询性能优化
VBA输出日志到工作簿demo
无法将“node.exe”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。
生命不息,刷题不止,简单题学习知识点
The latest MySql installation teaching, very detailed
【核心概念】图像分类和目标检测中的正负样本划分以及架构理解
