java 如何理解Full GC日志?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13398010/
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-10-31 12:34:00  来源:igfitidea点击:

How to understand the Full GC log?

javagarbage-collection

提问by Pomario

I currently see in PROD the following:

我目前在 PROD 中看到以下内容:

5429.779: [Full GC [PSYoungGen: 13809K->0K(505216K)] [PSOldGen: 253802K->245481K(319488K)] 267612K->245481K(824704K) [PSPermGen: 70059K->70059K(118784K)], 0.5869143 secs] [Times: user=0.59 sys=0.00, real=0.59 secs]

I understand that A->B(C) means: A, before gc, B after gc, C heap without tenured and perm

我理解 A->B(C) 的意思是:A,gc 之前,b,gc 之后,C heap without tenured and perm

What I don't understand is piece (outside all []s) which is 267612K->245481K(824704K). What does it refer to?

我不明白的是一块(在所有 [] 之外),它是267612K->245481K(824704K). 它指的是什么?

回答by Ravi K

May I advice you to use tools instead of manually reading logs.

我建议您使用工具而不是手动阅读日志。

Try HPJmetertool

试用HPJmeter工具

I find this tool best. Rest there are so many tools. Refer: Know of any Java garbage collection log analysis tools?

我觉得这个工具最好。休息有这么多工具。参考:知道任何Java垃圾收集日志分析工具吗?

Generally as per my experience, its always better to use tools like above which simply imports GC log file & gives detailed graphs for different generations. If you go for manual reading, then your time will be more invested in reading than performance analysis.

一般来说,根据我的经验,使用上面的工具总是更好,这些工具只是导入 GC 日志文件并提供不同代的详细图表。如果你去手动阅读,那么你的时间将更多地投入阅读而不是性能分析。

回答by Peter Lawrey

It's the total of the generations, meaning the combined Heap Usage and total Heap Size in real memory (shown in braces).

它是代的总数,意思是实际内存中的组合堆使用和总堆大小(显示在大括号中)。

In the given example, [PSYoungGen: 13809K->0K(505216K)] [PSOldGen: 253802K->245481K(319488K)] 267612K->245481K(824704K):

在给定的示例中,[PSYoungGen: 13809K->0K(505216K)] [PSOldGen: 253802K->245481K(319488K)] 267612K->245481K(824704K)

13809K + 253802K = 267612K

0K + 245481K = 245481K

505216K + 319488K = 824704K