如何从JVM分析和监视gc.log垃圾收集器日志文件 [英] How to analyse and monitor gc.log garbage collector log files from the JVM

查看:421
本文介绍了如何从JVM分析和监视gc.log垃圾收集器日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道可视化分析和监视java gc.log文件的最佳方法是什么.

I'm wondering what is the best way to visually analyse and monitor java gc.log files.

GCViewer 是迄今为止我发现的最有趣的工具,但我想知道是否有是监视多个远程gc.log文件的更好的解决方案,还是更好的解决方案.

GCViewer is the most interesting tool I've found so far, but I'm wondering if there is anything better or a good solution for monitoring multiple remote gc.log files.

推荐答案

我认为分析垃圾收集器日志的最有效方法是查看输出本身.我们的生产服务器全部使用并发标记扫描收集器运行,并且我的日志运行带有选项-Xloggc:$GCLOGFILE -XX:+PrintGCDetails,如果环境遇到问题,我

I think the most effective way for analyzing the garbage collector log is by looking at the output itself. Our production server all run using the Concurrent Mark Sweep Collector and I have the log running with the options -Xloggc:$GCLOGFILE -XX:+PrintGCDetails and if the environment runs into problems I

  1. 首先通过grepping"Full GC"来检查Full GC的数量,并且
  2. 检查CMS的数量和频率,并在收集阶段查找错误消息(通常从失败...开始").

我通常还会查看线程列表,并检查垃圾收集器消耗的cpu时间.我通过使用-p <java-pid>参数在顶部运行并随后按"H"来执行此操作,由此您可以看到消耗最多CPU时间的PID.然后可以将其与线程转储匹配,以查看gc线程是否是最耗时的线程.每个线程的转储中都显示一个pid,该pid以十六进制显示,可以与顶部的pid匹配.

I usually also look at the thread list and check the amount of cpu time the Garbage Collector consumes. I do this by running top with the -p <java-pid> Parameter and press "H" afterwards, with this you get to see the pids which consume the most cpu time. This then can be matched to a Thread Dump to see if gc threads are the most time consuming threads. Every thread has a pid displayed in the thread dump, which is in hex, this can be matched to the pids in top.

查看GC消耗的CPU时间并将其与您的日志输出相匹配非常重要.我尝试了几次GCViewer,但从视觉上看不到GC-Data的有用提示.

It is quite important to see the cpu times the GC consumes and match this to your log output. I tried the GCViewer several times but never really got useful hints from the visual display of the GC-Data.

这篇关于如何从JVM分析和监视gc.log垃圾收集器日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆