激情久久久_欧美视频区_成人av免费_不卡视频一二三区_欧美精品在欧美一区二区少妇_欧美一区二区三区的

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

PHP教程|ASP.NET教程|JAVA教程|ASP教程|編程技術(shù)|正則表達(dá)式|C/C++|IOS|C#|Swift|Android|JavaScript|易語(yǔ)言|

服務(wù)器之家 - 編程語(yǔ)言 - JAVA教程 - java9中g(shù)c log參數(shù)遷移

java9中g(shù)c log參數(shù)遷移

2021-04-09 11:06codecraft JAVA教程

本篇文章給大家詳細(xì)講述了java9中g(shù)c log參數(shù)遷移的相關(guān)知識(shí)點(diǎn),對(duì)此有需要的朋友可以參考學(xué)習(xí)下。

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

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

java9引進(jìn)了一個(gè)統(tǒng)一的日志框架,把gc相關(guān)的log輸出及配置也給納入進(jìn)來(lái)了。

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

Xlog語(yǔ)法

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
-Xlog[:option]
  option     := [<what>][:[<output>][:[<decorators>][:<output-options>]]]
            'help'
            'disable'
  what      := <selector>[,...]
  selector    := <tag-set>[*][=<level>]
  tag-set    := <tag>[+...]
            'all'
  tag      := name of tag
  level     := trace
            debug
            info
            warning
            error
  output     := 'stderr'
            'stdout'
            [file=]<filename>
  decorators   := <decorator>[,...]
            'none'
  decorator   := time
            uptime
            timemillis
            uptimemillis
            timenanos
            uptimenanos
            pid
            tid
            level
            tags
  output-options := <output_option>[,...]
  output-option := filecount=<file count>
            filesize=<file size in kb>
            parameter=value

what

主要是配置tag及l(fā)evel

tag

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

?
1
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

?
1
2
3
- 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í)間戳。比如

?
1
-Xlog:gc:demoapp-gc-%p-%t.log

 

輸出的文件名如下:

?
1
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è)。比如

?
1
[3.080s][info][gc,cpu ] GC(5) User=0.03s Sys=0.00s Real=0.01s

實(shí)例

?
1
-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í)例

?
1
2
3
4
5
6
7
8
9
10
[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中,可以按照官方給出的遷移表進(jìn)行遷移。

原文鏈接:https://segmentfault.com/a/1190000013475524

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 欧美日韩爱爱视频 | av免费在线网站 | 色999久久久精品人人澡69 | 羞羞的视频免费在线观看 | 国产91一区 | 免费视频xxxx| 毛片a级毛片免费播放100 | 国产精品视频一区二区三区四区五区 | 91美女视频在线观看 | 性大片1000免费看 | 天堂亚洲一区 | 黄视频免费在线观看 | 国产一区二区欧美 | 亚洲成人免费网站 | 欧美精品网址 | 成人电影毛片 | 一区国产在线观看 | 一级毛片电影网 | 欧美性视频一区二区 | 成人爽a毛片免费啪啪红桃视频 | 国人精品视频在线观看 | 亚洲成人中文字幕在线 | 91精品动漫在线观看 | 99re久久最新地址获取 | 亚洲精品久久久久久久久久 | 亚洲欧美国产视频 | 免费视频aaa | av在线免费看网站 | 国产免费网站视频 | 日韩视频www| 成人午夜视频免费看 | 九九视频在线观看黄 | 久久久久久片 | 亚洲精品欧美二区三区中文字幕 | 综合网日日天干夜夜久久 | 成人福利视频在线观看 | 精品无吗乱吗av国产爱色 | 末成年女av片一区二区 | 九九热在线视频观看 | 国产一级大片在线观看 | 91看片淫黄大片欧美看国产片 |