Reputation: 41
I have been using the following flags in my application using Java 8:-
1) PrintFLSStatistics=1
2) +PrintPromotionFailure
3) -XX:+PrintGCDateStamps
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.
Thanks for your time,
Upvotes: 3
Views: 2387
Reputation: 1014
In Java 11, you have to use -Xlog
instead. For example: java -Xlog:gc\*::time -jar my.jar
will log something like
[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*.
See:
Upvotes: 1