Is there a replacement for the garbage collection JVM args in Java 11?

后端 未结 3 2106
北荒
北荒 2020-12-13 18:42

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 partic

相关标签:
3条回答
  • 2020-12-13 19:02

    BTW, although the NumberOfGCLogFiles and GCLogFileSize options are gone in Java 11, it is still possible to set rolling file size and count. For example:

    java -Xlog:gc*,safepoint:gc.log:time,uptime:filecount=100,filesize=128K ...
    
    0 讨论(0)
  • 2020-12-13 19:06

    It does print date with time

    -Xlog:gc*:verbose_gc.log:time
    
    [2019-05-13T14:01:03.356+0530] Heap region size: 1M
    [2019-05-13T14:01:03.357+0530] Using G1
    

    NOTE :- JDK 11 been used

    0 讨论(0)
  • 2020-12-13 19:11

    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.

    0 讨论(0)
提交回复
热议问题