【问题标题】:Difference between -XX:+PrintGC and -verbose:gc-XX:+PrintGC 和 -verbose:gc 的区别
【发布时间】:2018-04-02 09:54:20
【问题描述】:

我想了解以下之间的区别: -XX:+PrintGC-verbose:gc 显然这些看起来很相似。

本文未列出verbose:gc http://www.oracle.com/technetwork/articles/java/vmoptions-jsp-140102.html

我也看到了这两个问题:How to redirect verbose garbage collection output to a file?https://stackoverflow.com/a/1818039/2266682 但无法得到太多理解。

【问题讨论】:

    标签: java garbage-collection jvm jvm-arguments


    【解决方案1】:

    在 JDK 8 中,-verbose:gcan exact alias 对应于 -XX:+PrintGC

    但是,-verbose:gc 是标准选项,而 -XX:+PrintGC 不是。

    -XX:+PrintGC 自 JDK 9 起已弃用,转而支持统一日志记录选项 -Xlog:gc,请参阅 JEP 158
    -verbose:gc 在 JDK 9 和 10 中仍然有效。

    【讨论】:

    • 不清楚-verbose:gc。它在 JDK9+ 中有什么作用吗?或者-Xlog:gc就够了
    • @turbanoff -verbose:gc 的行为与 -Xlog:gc 完全一样
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-30
    • 2016-11-14
    • 2019-07-30
    • 2019-08-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多