GC日志在线分析神器
导言
Java虚拟机(JVM)的垃圾回收(GC)不仅关系到内存资源的有效管理,更对业务性能产生着深远影响。
GC日志作为诊断JVM性能问题的关键信息源,常详尽且复杂,涉及大量的专业术语和技术细节,如堆内存划分、GC算法选择、停顿时间等,让许多开发者望而却步。今天介绍的神器,让人人都可以成为GC分析的专家。
一句话介绍
业内首款借助机器学习技术引导的垃圾回收日志分析工具。
官方宣传语
GCeasy 采用了先进的机器学习算法,可节省处理晦涩 GC 日志的时间,免除烦恼。可迅速发现内存泄漏、长时间 GC 停顿、过早的对象晋升以及许多其他影响性能的问题。
使用说明
就像怎么把一头大象装进冰箱一样简单,唯一的区别就是大象装不进去,而GC日志分析真的成功了:
- 打开(或登录)网站
- 上传你的gc日志文件
- 点击【分析】按钮,等着下载报告就好了
原始的gc日志信息,截取一小部分展示:
shell
2024-01-30T15:13:31.868+0800: 2.446: Total time for which application threads were stopped: 0.0002442 seconds, Stopping threads took: 0.0000703 seconds
2024-01-30T15:13:31.895+0800: 2.473: Total time for which application threads were stopped: 0.0002619 seconds, Stopping threads took: 0.0000670 seconds
2024-01-30T15:13:31.927+0800: 2.505: Total time for which application threads were stopped: 0.0002521 seconds, Stopping threads took: 0.0000770 seconds
2024-01-30T15:13:31.945+0800: 2.523: Total time for which application threads were stopped: 0.0008906 seconds, Stopping threads took: 0.0000898 seconds
2024-01-30T15:13:31.948+0800: 2.525: Total time for which application threads were stopped: 0.0004917 seconds, Stopping threads took: 0.0000535 seconds
2024-01-30T15:13:32.109+0800: 2.687: Total time for which application threads were stopped: 0.0003930 seconds, Stopping threads took: 0.0001287 seconds
2024-01-30T15:13:32.110+0800: 2.687: [GC (CMS Initial Mark) [1 CMS-initial-mark: 0K(1398144K)] 402692K(2027264K), 0.0868110 secs] [Times: user=0.08 sys=0.00, real=0.09 secs]
2024-01-30T15:13:32.197+0800: 2.774: Total time for which application threads were stopped: 0.0870775 seconds, Stopping threads took: 0.0001423 seconds
2024-01-30T15:13:32.197+0800: 2.774: [CMS-concurrent-mark-start]
2024-01-30T15:13:32.197+0800: 2.775: [CMS-concurrent-mark: 0.000/0.000 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
2024-01-30T15:13:32.197+0800: 2.775: [CMS-concurrent-preclean-start]
2024-01-30T15:13:32.199+0800: 2.777: [CMS-concurrent-preclean: 0.002/0.002 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
2024-01-30T15:13:32.199+0800: 2.777: [CMS-concurrent-abortable-preclean-start]
下面是一份gc日志分析报告开头的样子:
当然,这是一个健康的状态,但是仍然给了你一些优化建议,这就可以算作对GC问题开的药方。如果你去体检结果非常健康,报告上也会告诉你多吃蔬菜少喝酒一样的道理。
报告中的内容非常详实,还包括以下内容:
- 概览
- 建议
- JVM内存大小
- 关键性能指标
- 交互图表
- GC时间
- 内存泄露
- 连续Full GC
- JVM参数
More
喜欢我们的文章?关注公众号[1024点线面]吧!更多干货,倾情奉献。