成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

java9 gc log參數(shù)遷移

Kahn / 3556人閱讀

摘要:序本文主要研究一下參數(shù)的遷移。比如實(shí)例為,為,文件數(shù)為,每個(gè)文件,文件名為,為和輸出實(shí)例遷移舊版相關(guān)參數(shù)遷移舊版運(yùn)行時(shí)參數(shù)遷移小結(jié)把的配置統(tǒng)一到了中,可以按照官方給出的新舊參數(shù)映射表進(jìn)行遷移。

本文主要研究一下java9 gc log參數(shù)的遷移。

統(tǒng)一JVM及GC的Logging

java9引進(jìn)了一個(gè)統(tǒng)一的日志框架,對(duì)gc log的輸出進(jìn)行了統(tǒng)一的配置。

相關(guān)JEP(JDK Enhancement Proposal)

JEP 158: Unified JVM Logging

JEP 264: Platform Logging API and Service

JEP 271: Unified GC Logging

Xlog語法
-Xlog[:option]
    option         :=  [][:[][:[][:]]]
                       "help"
                       "disable"
    what           :=  [,...]
    selector       :=  [*][=]
    tag-set        :=  [+...]
                       "all"
    tag            :=  name of tag
    level          :=  trace
                       debug
                       info
                       warning
                       error
    output         :=  "stderr"
                       "stdout"
                       [file=]
    decorators     :=  [,...]
                       "none"
    decorator      :=  time
                       uptime
                       timemillis
                       uptimemillis
                       timenanos
                       uptimenanos
                       pid
                       tid
                       level
                       tags
    output-options :=  [,...]
    output-option  :=  filecount=
                       filesize=
                       parameter=value
what
主要是配置tag及l(fā)evel
tag

其中all代表所有的tag,其他的如下:

add,age,alloc,annotation,aot,arguments,attach,barrier,biasedlocking,blocks,bot,breakpoint,bytecode,census,class,classhisto,cleanup,compaction,comparator,constraints,constantpool,coops,cpu,cset,data,defaultmethods,dump,ergo,event,exceptions,exit,fingerprint,freelist,gc,hashtables,heap,humongous,ihop,iklass,init,itables,jfr,jni,jvmti,liveness,load,loader,logging,mark,marking,metadata,metaspace,method,mmu,modules,monitorinflation,monitormismatch,nmethod,normalize,objecttagging,obsolete,oopmap,os,pagesize,parser,patch,path,phases,plab,preorder,promotion,protectiondomain,purge,redefine,ref,refine,region,remset,resolve,safepoint,scavenge,scrub,setting,stackmap,stacktrace,stackwalk,start,startuptime,state,stats,stringdedup,stringtable,subclass,survivor,sweep,system,task,thread,time,timer,tlab,unload,update,verification,verify,vmoperation,vtables,workgang
level
主要分off,trace,debug,info,warning,error
output
- stdout(`Sends output to stdout`)
- stderr(`Sends output to stderr`)
- file=filename(`Sends output to text file(s)`)
有如上三種,其中指定file的話,可以使用%p變量表示當(dāng)前jvm的pid,用%t表示jvm的啟動(dòng)時(shí)間戳。比如
-Xlog:gc:demoapp-gc-%p-%t.log

輸出的文件名如下:

demoapp-gc-1678-2018-03-01_21-44-18.log
decorators

time -- Current time and date in ISO-8601 format

uptime -- Time since the start of the JVM in seconds and milliseconds (e.g., 6.567s)

timemillis -- The same value as generated by System.currentTimeMillis()

uptimemillis -- Milliseconds since the JVM started

timenanos -- The same value as generated by System.nanoTime()

uptimenanos -- Nanoseconds since the JVM started

pid -- The process identifier

tid -- The thread identifier

level -- The level associated with the log message

tags -- The tag-set associated with the log message

不指定的話,默認(rèn)是uptime, level, and tags這三個(gè)。比如
[3.080s][info][gc,cpu        ] GC(5) User=0.03s Sys=0.00s Real=0.01s
實(shí)例
-Xlog:gc=trace:file=gctrace.txt:uptimemillis,pid:filecount=5,filesize=1024
tag為gc,levle為trace,rotate文件數(shù)為5,每個(gè)文件1M,文件名為gctrace.txt,decrotators為uptimemillis和pid

輸出實(shí)例

[1110ms][1867] GC(2) Pause Remark 17M->17M(256M) 2.024ms
[1110ms][1867] GC(2) Finalize Live Data 0.000ms
[1110ms][1867] GC(2) Pause Cleanup 17M->17M(256M) 0.177ms
[1112ms][1867] GC(2) Concurrent Cycle 7.470ms
[2951ms][1867] GC(3) Pause Initial Mark (Metadata GC Threshold) 149M->30M(256M) 27.175ms
[2951ms][1867] GC(4) Concurrent Cycle
[2972ms][1867] GC(4) Pause Remark 32M->32M(256M) 5.132ms
[2974ms][1867] GC(4) Finalize Live Data 0.000ms
[2974ms][1867] GC(4) Pause Cleanup 32M->32M(256M) 0.214ms
[2976ms][1867] GC(4) Concurrent Cycle 25.422ms
遷移 舊版GC相關(guān)參數(shù)遷移
Legacy Garbage Collection (GC) Flag Xlog Configuration Comment
G1PrintHeapRegions -Xlog:gc+region=trace Not Applicable
GCLogFileSize No configuration available Log rotation is handled by the framework.
NumberOfGCLogFiles Not Applicable Log rotation is handled by the framework.
PrintAdaptiveSizePolicy -Xlog:ergo*=level Use a level of debug for most of the information, or a level of trace for all of what was logged for PrintAdaptiveSizePolicy.
PrintGC -Xlog:gc Not Applicable
PrintGCApplicationConcurrentTime -Xlog:safepoint Note that PrintGCApplicationConcurrentTime and PrintGCApplicationStoppedTime are logged on the same tag and aren’t separated in the new logging.
PrintGCApplicationStoppedTime -Xlog:safepoint Note that PrintGCApplicationConcurrentTime and PrintGCApplicationStoppedTime are logged on the same tag and not separated in the new logging.
PrintGCCause Not Applicable GC cause is now always logged.
PrintGCDateStamps Not Applicable Date stamps are logged by the framework.
PrintGCDetails -Xlog:gc* Not Applicable
PrintGCID Not Applicable GC ID is now always logged.
PrintGCTaskTimeStamps -Xlog:task*=debug Not Applicable
PrintGCTimeStamps Not Applicable Time stamps are logged by the framework.
PrintHeapAtGC -Xlog:gc+heap=trace Not Applicable
PrintReferenceGC -Xlog:ref*=debug Note that in the old logging, PrintReferenceGC had an effect only if PrintGCDetails was also enabled.
PrintStringDeduplicationStatistics -Xlog:stringdedup*=debug Not Applicable
PrintTenuringDistribution -Xlog:age*=level Use a level of debug for the most relevant information, or a level of trace for all of what was logged for PrintTenuringDistribution.
UseGCLogFileRotation Not Applicable What was logged for PrintTenuringDistribution.
舊版運(yùn)行時(shí)參數(shù)遷移
Legacy Runtime Flag Xlog Configuration Comment
TraceExceptions -Xlog:exceptions=info Not Applicable
TraceClassLoading -Xlog:class+load=level Use level=info for regular information, or level=debug for additional information. In Unified Logging syntax, -verbose:class equals -Xlog:class+load=info,class+unload=info.
TraceClassLoadingPreorder -Xlog:class+preorder=debug Not Applicable
TraceClassUnloading -Xlog:class+unload=level Use level=info for regular information, or level=trace for additional information. In Unified Logging syntax, -verbose:class equals -Xlog:class+load=info,class+unload=info.
VerboseVerification -Xlog:verification=info Not Applicable
TraceClassPaths -Xlog:class+path=info Not Applicable
TraceClassResolution -Xlog:class+resolve=debug Not Applicable
TraceClassInitialization -Xlog:class+init=info Not Applicable
TraceLoaderConstraints -Xlog:class+loader+constraints=info Not Applicable
TraceClassLoaderData -Xlog:class+loader+data=level Use level=debug for regular information or level=trace for additional information.
TraceSafepointCleanupTime -Xlog:safepoint+cleanup=info Not Applicable
TraceSafepoint -Xlog:safepoint=debug Not Applicable
TraceMonitorInflation -Xlog:monitorinflation=debug Not Applicable
TraceBiasedLocking -Xlog:biasedlocking=level Use level=info for regular information, or level=trace for additional information.
TraceRedefineClasses -Xlog:redefine+class*=level level=info, =debug, and =trace provide increasing amounts of information.
小結(jié)

java9把gc log的配置統(tǒng)一到了Xlog中,可以按照官方給出的新舊參數(shù)映射表進(jìn)行遷移。

doc

Enable Logging with the JVM Unified Logging Framework

-Xlog Output

Convert GC Logging Flags to Xlog

Convert Runtime Logging Flags to Xlog

文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/68647.html

相關(guān)文章

  • Java9的新特性

    摘要:新特性概述系列一安裝及使用系列二運(yùn)行系列三模塊系統(tǒng)精要系列四更新系列五系列六系列七系列八系列九與的區(qū)別遷移注意事項(xiàng)參數(shù)遷移相關(guān)選項(xiàng)解析使用構(gòu)建實(shí)例使用示例帶你提前了解中的新特性 Java語言特性系列 Java5的新特性 Java6的新特性 Java7的新特性 Java8的新特性 Java9的新特性 Java10的新特性 Java11的新特性 Java12的新特性 Java13的新特性...

    ddongjian0000 評(píng)論0 收藏0
  • Java9模塊化學(xué)習(xí)筆記三之遷移Java9

    摘要:命令行參數(shù)文件鑒于遷移到后可能需要很長的命令行參數(shù),有些會(huì)限制命令行長度,支持定義一個(gè)命令行參數(shù)文件。已有三分庫可以自動(dòng)轉(zhuǎn)成模塊,只要在啟動(dòng)時(shí)將放在指定路徑中,便會(huì)自動(dòng)變成。 java[c]命令行參數(shù)文件 鑒于遷移到j(luò)ava9后可能需要很長的命令行參數(shù),有些os會(huì)限制命令行長度,java9支持定義一個(gè)命令行參數(shù)文件。使用方式: java @arguments.txt arguments...

    NeverSayNever 評(píng)論0 收藏0
  • JAVA9-12新特性簡述

    摘要:本文是個(gè)人在企業(yè)內(nèi)部分享使用的簡要大綱,列舉了的重要更新,文章的結(jié)構(gòu)較簡單,也不規(guī)范,鑒于近期寫若干文章時(shí)總會(huì)忘記一些新特性所處的版本,特將此大綱流留用。 本文是個(gè)人在企業(yè)內(nèi)部分享使用的簡要大綱,列舉了JAVA9-12的重要更新,文章的結(jié)構(gòu)較簡單,也不規(guī)范,鑒于近期寫若干文章時(shí)總會(huì)忘記一些新特性所處的版本,特將此大綱流copy留用。 一 JAVA9 新特性 1.Java Platfo...

    TigerChain 評(píng)論0 收藏0
  • 54個(gè)JAVA官方文檔重要術(shù)語

    摘要:近期在閱讀最新幾版的官方文檔過程中發(fā)現(xiàn)不少術(shù)語不清之處特發(fā)此文總結(jié)以下的術(shù)語大量在官方文檔中直接出現(xiàn)且直接如基本詞語一樣使用不理解它們會(huì)嚴(yán)重影響閱讀自適應(yīng)自旋鎖自適應(yīng)自旋鎖是一個(gè)允許線程在特定點(diǎn)自旋等待特定事件發(fā)生而不是直接進(jìn)行并等待該事件 近期在閱讀JAVA最新幾版的官方文檔過程中發(fā)現(xiàn)不少術(shù)語不清之處,特發(fā)此文總結(jié).以下的術(shù)語大量在官方文檔中直接出現(xiàn),且直接如基本詞語一樣使用,不理解...

    longmon 評(píng)論0 收藏0
  • ForkJoin框架之CompletableFuture

    摘要:內(nèi)部類,用于對(duì)和異常進(jìn)行包裝,從而保證對(duì)進(jìn)行只有一次成功。是取消異常,轉(zhuǎn)換后拋出。判斷是否使用的線程池,在中持有該線程池的引用。 前言 近期作者對(duì)響應(yīng)式編程越發(fā)感興趣,在內(nèi)部分享JAVA9-12新特性過程中,有兩處特性讓作者深感興趣:1.JAVA9中的JEP266對(duì)并發(fā)編程工具的更新,包含發(fā)布訂閱框架Flow和CompletableFuture加強(qiáng),其中發(fā)布訂閱框架以java.base...

    lindroid 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

最新活動(dòng)
閱讀需要支付1元查看
<