-XX:+ PrintGC和-verbose:gc之间的区别 [英] Difference between -XX:+PrintGC and -verbose:gc
问题描述
我想了解以下两者之间的区别:
-XX:+PrintGC
和-verbose:gc
显然,这些看起来很相似.
I want to understand the difference between:
-XX:+PrintGC
and -verbose:gc
Apparently these look similar.
本文未列出verbose:gc
http://www.oracle.com/technetwork/articles/java /vmoptions-jsp-140102.html
我还看到了两个问题:如何将详细的垃圾回收输出重定向到文件?和 https://stackoverflow.com/a/1818039/2266682 但了解得不多.
I also saw these two questions: How to redirect verbose garbage collection output to a file? and https://stackoverflow.com/a/1818039/2266682 but couldn't get much understanding.
推荐答案
In JDK 8 -verbose:gc
is an exact alias for -XX:+PrintGC
.
但是,-verbose:gc
是标准选项,而-XX:+PrintGC
不是标准选项.
However, -verbose:gc
is a standard option, while -XX:+PrintGC
is not.
-XX:+PrintGC
,而不再推荐使用统一日志记录选项-Xlog:gc
,请参见 JEP 158 .
-verbose:gc
仍可在JDK 9和10中使用.
-XX:+PrintGC
is deprecated since JDK 9 in favor of unified logging option -Xlog:gc
, see JEP 158.
-verbose:gc
still works in JDK 9 and 10.
这篇关于-XX:+ PrintGC和-verbose:gc之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!