gpt4 book ai didi

java - Java 11 中 Java 8 的 JVM 标志的替代方案

转载 作者:行者123 更新时间:2023-12-01 14:32:46 31 4
gpt4 key购买 nike

我一直在使用 Java 8 的应用程序中使用以下标志:-

1) PrintFLSSatistics=1

2) +PrintPromotionFailure

3) -XX:+PrintGCDateStamps

4) -XX:+打印GCDetails

我一直在移动应用程序以使用 Java 11 而不是 Java 8。看来这些标志在 Java 11 中已弃用或不受支持。请告诉 Java 11 中这些标志的替代方案。

谢谢你的时间,

最佳答案

在 Java 11 中,您必须改用 -Xlog。例如:java -Xlog:gc\*::time -jar my.jar 将记录如下内容

[2020-02-19T18:32:50.107-0300] Heap region size: 1M
[2020-02-19T18:32:50.119-0300] Using G1
[2020-02-19T18:32:50.119-0300] Heap address: 0x000000070a200000, size: 3934 MB, Compressed Oops mode: Zero based, Oop shift amount: 3

-Xlog is the general logging configuration option for logging in the HotSpot JVM. It's a tag-based system where gc is one of the tags. To get more information about what a GC is doing, you can configure logging to print any message that has the gc tag and any other tag. The command line option for this is -Xlog:gc*.

参见:

关于java - Java 11 中 Java 8 的 JVM 标志的替代方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60306113/

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