简体   繁体   English

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

[英]Alternative for JVM Flags of Java 8 in Java 11

I have been using the following flags in my application using Java 8:-我一直在使用 Java 8 的应用程序中使用以下标志:-

1) PrintFLSStatistics=1 1) PrintFLSStatistics=1

2) +PrintPromotionFailure 2) +PrintPromotionFailure

3) -XX:+PrintGCDateStamps 3) -XX:+PrintGCDateStamps

4) -XX:+PrintGCDetails 4) -XX:+PrintGCDetails

I have been moving the application to use Java 11 instead of Java 8. It seems these flags are either deprecated or not supported in Java 11. Please tell the alternatives of these flags in Java 11.我一直在移动应用程序以使用 Java 11 而不是 Java 8。这些标志似乎已被弃用或在 Java 11 中不受支持。请告诉 Java 11 中这些标志的替代方案。

Thanks for your time,谢谢你的时间,

In Java 11, you have to use -Xlog instead.在 Java 11 中,您必须改用-Xlog For example: java -Xlog:gc\\*::time -jar my.jar will log something like例如: 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. -Xlog 是用于在 HotSpot JVM 中进行日志记录的通用日志记录配置选项。 It's a tag-based system where gc is one of the tags.这是一个基于标签的系统,其中 gc 是标签之一。 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.要获得有关 GC 正在做什么的更多信息,您可以配置日志记录以打印具有 gc 标记和任何其他标记的任何消息。 The command line option for this is -Xlog:gc*.为此,命令行选项是 -Xlog:gc*。

See:看:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM