摘要:序本文主要研究一下參數(shù)的遷移。比如實例為,為,文件數(shù)為,每個文件,文件名為,為和輸出實例遷移舊版相關參數(shù)遷移舊版運行時參數(shù)遷移小結把的配置統(tǒng)一到了中,可以按照官方給出的新舊參數(shù)映射表進行遷移。
序
本文主要研究一下java9 gc log參數(shù)的遷移。
統(tǒng)一JVM及GC的Loggingjava9引進了一個統(tǒng)一的日志框架,對gc log的輸出進行了統(tǒng)一的配置。
相關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 := [what][:[
主要是配置tag及l(fā)eveltag
其中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,workganglevel
主要分off,trace,debug,info,warning,erroroutput
- stdout(`Sends output to stdout`) - stderr(`Sends output to stderr`) - file=filename(`Sends output to text file(s)`)
有如上三種,其中指定file的話,可以使用%p變量表示當前jvm的pid,用%t表示jvm的啟動時間戳。比如
-Xlog:gc:demoapp-gc-%p-%t.log
輸出的文件名如下:
demoapp-gc-1678-2018-03-01_21-44-18.logdecorators
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
不指定的話,默認是uptime, level, and tags這三個。比如
[3.080s][info][gc,cpu ] GC(5) User=0.03s Sys=0.00s Real=0.01s實例
-Xlog:gc=trace:file=gctrace.txt:uptimemillis,pid:filecount=5,filesize=1024
tag為gc,levle為trace,rotate文件數(shù)為5,每個文件1M,文件名為gctrace.txt,decrotators為uptimemillis和pid
輸出實例
[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相關參數(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. |
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. |
java9把gc log的配置統(tǒng)一到了Xlog中,可以按照官方給出的新舊參數(shù)映射表進行遷移。
docEnable Logging with the JVM Unified Logging Framework
-Xlog Output
Convert GC Logging Flags to Xlog
Convert Runtime Logging Flags to Xlog
文章版權歸作者所有,未經(jīng)允許請勿轉載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/68647.html
摘要:新特性概述系列一安裝及使用系列二運行系列三模塊系統(tǒng)精要系列四更新系列五系列六系列七系列八系列九與的區(qū)別遷移注意事項參數(shù)遷移相關選項解析使用構建實例使用示例帶你提前了解中的新特性 Java語言特性系列 Java5的新特性 Java6的新特性 Java7的新特性 Java8的新特性 Java9的新特性 Java10的新特性 Java11的新特性 Java12的新特性 Java13的新特性...
摘要:命令行參數(shù)文件鑒于遷移到后可能需要很長的命令行參數(shù),有些會限制命令行長度,支持定義一個命令行參數(shù)文件。已有三分庫可以自動轉成模塊,只要在啟動時將放在指定路徑中,便會自動變成。 java[c]命令行參數(shù)文件 鑒于遷移到java9后可能需要很長的命令行參數(shù),有些os會限制命令行長度,java9支持定義一個命令行參數(shù)文件。使用方式: java @arguments.txt arguments...
摘要:本文是個人在企業(yè)內(nèi)部分享使用的簡要大綱,列舉了的重要更新,文章的結構較簡單,也不規(guī)范,鑒于近期寫若干文章時總會忘記一些新特性所處的版本,特將此大綱流留用。 本文是個人在企業(yè)內(nèi)部分享使用的簡要大綱,列舉了JAVA9-12的重要更新,文章的結構較簡單,也不規(guī)范,鑒于近期寫若干文章時總會忘記一些新特性所處的版本,特將此大綱流copy留用。 一 JAVA9 新特性 1.Java Platfo...
摘要:近期在閱讀最新幾版的官方文檔過程中發(fā)現(xiàn)不少術語不清之處特發(fā)此文總結以下的術語大量在官方文檔中直接出現(xiàn)且直接如基本詞語一樣使用不理解它們會嚴重影響閱讀自適應自旋鎖自適應自旋鎖是一個允許線程在特定點自旋等待特定事件發(fā)生而不是直接進行并等待該事件 近期在閱讀JAVA最新幾版的官方文檔過程中發(fā)現(xiàn)不少術語不清之處,特發(fā)此文總結.以下的術語大量在官方文檔中直接出現(xiàn),且直接如基本詞語一樣使用,不理解...
摘要:內(nèi)部類,用于對和異常進行包裝,從而保證對進行只有一次成功。是取消異常,轉換后拋出。判斷是否使用的線程池,在中持有該線程池的引用。 前言 近期作者對響應式編程越發(fā)感興趣,在內(nèi)部分享JAVA9-12新特性過程中,有兩處特性讓作者深感興趣:1.JAVA9中的JEP266對并發(fā)編程工具的更新,包含發(fā)布訂閱框架Flow和CompletableFuture加強,其中發(fā)布訂閱框架以java.base...
閱讀 4982·2021-11-25 09:43
閱讀 1685·2021-10-27 14:18
閱讀 1057·2021-09-22 16:03
閱讀 1349·2019-08-30 13:19
閱讀 1572·2019-08-30 11:15
閱讀 1645·2019-08-26 14:04
閱讀 3124·2019-08-23 18:40
閱讀 1166·2019-08-23 18:17