find which type of garbage collector is running

后端 未结 10 953
旧巷少年郎
旧巷少年郎 2020-12-04 08:58

Post JSE 5 ergonomics is intended to automatically select the appropriate type of garbage collector for you (among other things).

I would like to know if there is an

10条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 09:54

    You could use the following VM arguments with JDK 14,

    -Xlog:gc -Xlog:gc*
    

    The log will be:

    [0.008s][info][gc,heap] Heap region size: 1M
    [0.008s][info][gc,heap,coops] Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
    [0.011s][info][gc           ] Using G1
    [0.011s][info][gc,cds       ] Mark closed archive regions in map: [0x00000007bff00000, 0x00000007bff7aff8]
    [0.011s][info][gc,cds       ] Mark open archive regions in map: [0x00000007bfe00000, 0x00000007bfe50ff8]
    [0.027s][info][gc           ] Periodic GC disabled
    

提交回复
热议问题