In Java 11 a number of JVM args relating to GC logging are not supported anymore. What, if anything, can they be replaced with, if we still want to use GC logging? In particular, this relates to the following JVM args:
-Xlog:gc:work/logs/gc.log -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles -XX:GCLogFileSize
Thanks.
G1GC. The default garbage collector in Java 11 is the G1 garbage collector (G1GC). The aim of G1GC is to strike a balance between latency and throughput. The G1 garbage collector attempts to achieve high throughput by meeting pause time goals with high probability.
Z Garbage Collector (ZGC) ZGC is a low-latency garbage collector that works well with very large (multi-terabyte) heaps. Like G1, ZGC works concurrently with the application. ZGC is concurrent, single-generation, region-based, NUMA-aware, and compacting.
You really can't force Java GC. The Java garbage collection algos are non-deterministic, and while all of these methods can motivate the JVM to do GC, you can't actually force it.
G1 Garbage Collector is the default garbage collection of Java 9. G1 collector replaced the CMS collector since it's more performance efficient. How G1 Garbage Collector works is different from other collectors. Unlike other collectors, the G1 collector partitions the heap space into multiple equal-sized regions.
List of your <arguments, current mapping, reasons>
is as follows:
-XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps ==> decoration options -Xlog:::time,level,tags
-XX:+PrintGCDetails ==> -Xlog:gc*
-XX:+PrintGCApplicationStoppedTime ==> -Xlog:safepoint
Note: PrintGCApplicationConcurrentTime
and PrintGCApplicationStoppedTime
are logged on the same tag and not separated in the new logging.
-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles -XX:GCLogFileSize ==> output options -Xlog::::filecount=5,filesize=1024
The bits that are handled by the framework do require tweaking
Reference: The documentation I've referred to and request you to follow for such migration details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With