知道任何 Java 垃圾收集日志分析工具吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/541832/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 16:00:27  来源:igfitidea点击:

Know of any Java garbage collection log analysis tools?

javaperformancelogginggarbage-collection

提问by braveterry

I'm looking for a tool or a script that will take the console log from my web app, parse out the garbage collection information and display it in a meaningful way.

我正在寻找一种工具或脚本,可以从我的 Web 应用程序中获取控制台日志,解析垃圾收集信息并以有意义的方式显示它。

I'm starting up on a Sun Java 1.4.2 JVM with the following flags:

我正在使用以下标志在 Sun Java 1.4.2 JVM 上启动:

-verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails

The log output looks like this:

日志输出如下所示:

54.736: [Full GC 54.737: [Tenured: 172798K->18092K(174784K), 2.3792658 secs] 257598K->18092K(259584K), [Perm : 20476K->20476K(20480K)], 2.4715398 secs]

Making sense of a few hundred of these kinds of log entries would be much easier if I had a tool that would visually graph garbage collection trends.

如果我有一个工具可以直观地绘制垃圾收集趋势图,那么理解数百个此类日志条目会容易得多。

采纳答案by bajafresh4life

IBM's GC toolkit does exactly what you ask.

IBM 的 GC 工具包完全符合您的要求。

https://www.ibm.com/developerworks/java/jdk/tools/gcmv/

https://www.ibm.com/developerworks/java/jdk/tools/gcmv/

I'm not sure if it's compatible with GC logs from Sun's JVM though.

不过,我不确定它是否与来自 Sun JVM 的 GC 日志兼容。

回答by Petteri Hietavirta

How about trying out some profiling tool like JProbe Freeware (Eclipse plug-in).

试试像 JProbe Freeware(Eclipse 插件)这样的分析工具怎么样?

回答by Johannes Weiss

jconsolecan help you a lot, but I think it's Java 5 and later only. Once I heard someone of SUN speaking at our university and he said that Java 6's garbage collector is A LOT better than the old ones which needed complicated tuning nearly all the time for big applications. Java 6 GC seems to scale a lot better on SMPs.

jconsole可以为您提供很多帮助,但我认为它仅适用于 Java 5 及更高版本。有一次我在我们大学听到 SUN 的一个人的演讲,他说 Java 6 的垃圾收集器比旧的垃圾收集器要好很多,旧的垃圾收集器几乎一直都需要为大型应用程序进行复杂的调整。Java 6 GC 在 SMP 上的扩展性似乎更好。

回答by Nick Fortescue

I use YourKit java profiler, which lets you measure this sort of thing, and much more, but using it's own format rather than analysing the log. It can do more under Java 5, but should work under 1.4.

我使用YourKit java profiler,它可以让你测量这类事情,还有更多,但使用它自己的格式而不是分析日志。它可以在 Java 5 下做更多,但应该在 1.4 下工作。

回答by duffymo

Try VisualGCfrom Sun. There are JDK 4 and 5 versions that give you a nice visual of what's going on in the eden, generational, and perm spaces. You need to add a JAR and get a PID and Bob's your uncle.

试试Sun 的VisualGC。有 JDK 4 和 5 版本可以让您很好地了解伊甸园、世代和永久空间中发生的事情。您需要添加一个 JAR 并获得一个 PID,而 Bob 是您的叔叔。

回答by fred-o

Even better than jconsole is visualvm, which is developed and distributed freely by Sun. It has a GC analyzing plugin called gchistowhich might help you.

比 jconsole 更好的是visualvm,它由 Sun 免费开发和分发。它有一个名为gchisto的 GC 分析插件,可能会对您有所帮助。

Edit:Sorry, I didn't see your JDK 1.4.2 requirement. In that case visualvm won't help you, alas.

编辑:抱歉,我没有看到您的 JDK 1.4.2 要求。在这种情况下,visualvm 不会帮助你,唉。

回答by kohlerm

gcviewerdoes what you want.

gcviewer做你想做的事。

回答by fglez

I think some people are adding Java probes which don't really parse garbage collection logs as the question states...

我认为有些人正在添加 Java 探测器,这些探测器并没有真正解析垃圾收集日志,如问题所述......

I've tried others (gcviewer, gchisto, IBM's) and the best tool I found for analyzing GC logs is HPjmeter

我试过其他人(gcviewer、gchisto、IBM 的),我发现的用于分析 GC 日志的最佳工具是HPjmeter

It is mainly for HP-UX JVMs, but it also usually works with Sun JVMs and does a great job.

它主要用于 HP-UX JVM,但它通常也适用于 Sun JVM 并且做得很好。

alt text
(source: xebia.com)

替代文字
(来源:xebia.com

回答by user504279

gchisto plugin for VisualVM doesn't work https://gchisto.dev.java.net/

VisualVM 的 gchisto 插件不起作用https://gchisto.dev.java.net/

I have a file with all details of printgc for jdk1.6 but couldn't find a tool to read that. Previously with jdk1.5 we used HPjmeter it worked fine, but now with jdk1.6 it doesn't

我有一个文件,其中包含 jdk1.6 的 printgc 的所有详细信息,但找不到读取该文件的工具。以前使用 jdk1.5 我们使用 HPjmeter 它工作正常,但现在使用 jdk1.6 它不

Tried following: IBM Pattern Modeling and Analysis Tool for Java Garbage Collector -- it doesn't recognizes the file. GCCollector doesn't work, it keep on reading file for analysis.

尝试了以下操作:用于 Java 垃圾收集器的 IBM 模式建模和分析工具——它无法识别该文件。GCCollector 不起作用,它继续读取文件进行分析。

回答by mnasce zewdu

A few years ago, John Coomes (Hotspot GC group) had released PrintGCStats, an awk script to "summarize statistics about garbage collection, in particular gc pause time totals, averages, maximum and standard deviations.". A copy of the script is hosted on java.net : http://java.net/projects/printgcstats

几年前,John Coomes(Hotspot GC 小组)发布了 PrintGCStats,这是一个 awk 脚本,用于“汇总有关垃圾收集的统计信息,特别是 gc 暂停时间总计、平均值、最大值和标准偏差。”。该脚本的副本托管在 java.net 上:http: //java.net/projects/printgcstats