gpt4 book ai didi

garbage-collection - 如何将详细的垃圾收集输出重定向到文件?

转载 作者:IT老高 更新时间:2023-10-28 13:51:36 26 4
gpt4 key购买 nike

如何将详细垃圾回收输出重定向到文件? Sun 的网站显示了一个适用于 Unix 的示例,但它不适用于 Windows。

最佳答案

来自java -X的输出:

    -Xloggc:<file>    log GC status to a file with time stamps

已记录 here :

-Xloggc:filename

Sets the file to which verbose GC events information should be redirected for logging. The information written to this file is similar to the output of -verbose:gc with the time elapsed since the first GC event preceding each logged event. The -Xloggc option overrides -verbose:gc if both are given with the same java command.

Example:

    -Xloggc:garbage-collection.log

所以输出看起来像这样:

0.590: [GC 896K->278K(5056K), 0.0096650 secs]0.906: [GC 1174K->774K(5056K), 0.0106856 secs]1.320: [GC 1670K->1009K(5056K), 0.0101132 secs]1.459: [GC 1902K->1055K(5056K), 0.0030196 secs]1.600: [GC 1951K->1161K(5056K), 0.0032375 secs]1.686: [GC 1805K->1238K(5056K), 0.0034732 secs]1.690: [Full GC 1238K->1238K(5056K), 0.0631661 secs]1.874: [GC 62133K->61257K(65060K), 0.0014464 secs]

关于garbage-collection - 如何将详细的垃圾收集输出重定向到文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1161647/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com