日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

GC日志参数详解

發布時間:2025/3/21 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 GC日志参数详解 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

1 輸出GC簡要信息

-verbose:gc 或-XX:+PrintGC

[GC (Allocation Failure) 7987K->5378K(19456K), 0.0133927 secs][GC (Allocation Failure) 13570K->11246K(19456K), 0.0220739 secs][Full GC (Ergonomics) 11246K->11188K(19456K), 0.2417921 secs][Full GC (Ergonomics) 18717K->16418K(19456K), 0.2618319 secs][Full GC (Allocation Failure) 16418K->16398K(19456K), 0.1658426 secs]

?

7987K->5378K(19456K),?0.0133927?secs含義:GC前已使用容量->GC后已使用容量(總容量),GC耗時,單位s

GC (Allocation Failure) :說明GC類型,括號中說明發生GC的原因。如這里說明發生了minor?gc,原因是內存分配失敗。

2 輸出GC詳細信息

-XX:+PrintGCDetails

[GC (Allocation Failure) [PSYoungGen: 7970K->1017K(9216K)] 7970K->5382K(19456K), 0.0165871 secs] [Times: user=0.05 sys=0.00, real=0.02 secs] [GC (Allocation Failure) --[PSYoungGen: 9209K->9209K(9216K)] 13574K->19444K(19456K), 0.0325471 secs] [Times: user=0.08 sys=0.00, real=0.03 secs] [Full GC (Ergonomics) [PSYoungGen: 9209K->0K(9216K)] [ParOldGen: 10234K->10180K(10240K)] 19444K->10180K(19456K), [Metaspace: 3150K->3150K(1056768K)], 0.2389364 secs] [Times: user=0.36 sys=0.00, real=0.24 secs]

?[PSYoungGen:?7970K->1017K(9216K)] 含義:新生代:GC前已使用容量->GC后已使用容量(新生代總容量)

7970K->5382K(19456K)含義:整個java堆:GC前已使用容量->GC后已使用總容量(java堆總容量)

?0.0165871?secs 含義:GC耗時,單位s

HeapPSYoungGen total 9216K, used 8192K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)eden space 8192K, 100% used [0x00000000ff600000,0x00000000ffe00000,0x00000000ffe00000)from space 1024K, 0% used [0x00000000ffe00000,0x00000000ffe00000,0x00000000fff00000)to space 1024K, 48% used [0x00000000fff00000,0x00000000fff7be10,0x0000000100000000)ParOldGen total 10240K, used 7990K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)object space 10240K, 78% used [0x00000000fec00000,0x00000000ff3cd898,0x00000000ff600000)Metaspace used 3182K, capacity 4600K, committed 4864K, reserved 1056768Kclass space used 357K, capacity 424K, committed 512K, reserved 1048576K

PSYoungGen??????total?9216K,?used?8192K?[0x00000000ff600000,?0x0000000100000000,?0x0000000100000000)含義:

新生代總大小9216K,已使用8192K,內存申請起始地址,已申請到的終點位置,最多能申請到的位置

3 GC前后堆的詳細信息

-XX:+PrintHeapAtGC

{Heap before GC invocations=1 (full 0):PSYoungGen total 9216K, used 7969K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)eden space 8192K, 97% used [0x00000000ff600000,0x00000000ffdc86a8,0x00000000ffe00000)from space 1024K, 0% used [0x00000000fff00000,0x00000000fff00000,0x0000000100000000)to space 1024K, 0% used [0x00000000ffe00000,0x00000000ffe00000,0x00000000fff00000)ParOldGen total 10240K, used 0K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)object space 10240K, 0% used [0x00000000fec00000,0x00000000fec00000,0x00000000ff600000)Metaspace used 3150K, capacity 4600K, committed 4864K, reserved 1056768Kclass space used 353K, capacity 424K, committed 512K, reserved 1048576K[GC (Allocation Failure) [PSYoungGen: 7969K->1001K(9216K)] 7969K->5366K(19456K), 0.0150862 secs] [Times: user=0.03 sys=0.00, real=0.02 secs] Heap after GC invocations=1 (full 0):PSYoungGen total 9216K, used 1001K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)eden space 8192K, 0% used [0x00000000ff600000,0x00000000ff600000,0x00000000ffe00000)from space 1024K, 97% used [0x00000000ffe00000,0x00000000ffefa798,0x00000000fff00000)to space 1024K, 0% used [0x00000000fff00000,0x00000000fff00000,0x0000000100000000)ParOldGen total 10240K, used 4364K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)object space 10240K, 42% used [0x00000000fec00000,0x00000000ff0432e0,0x00000000ff600000)Metaspace used 3150K, capacity 4600K, committed 4864K, reserved 1056768Kclass space used 353K, capacity 424K, committed 512K, reserved 1048576K}

invocations=1:發生GC的總次數(Major GC, Full GC)

full?0:發生Full GC的總次數

4 OOM dump文件轉儲

-XX:+HeapDumpOnOutOfMemoryError :發生OutOfMemoryError時,轉儲堆快照

-XX:HeapDumpPath=E:\java\dump :指定dump文件路徑,不指定則默認放到項目路徑下

可使用Memory Analyzer分析dump文件,

Eclipse安裝地址:http://download.eclipse.org/mat/1.6.1/update-site/

下載地址:http://www.eclipse.org/mat/downloads.php

5 其他GC參數

-XX:+PrintGCTimeStamps:GC發生的時間,自JVM啟動以后以秒計量

-XX:+PrintGCApplicationStoppedTime:輸出GC造成應用暫停的時間,如:

Total?time?for?which?application?threads?were?stopped:?0.3797230?seconds,?Stopping?threads?took:?0.0000215?seconds

-XX:+PrintGCDateStamps:GC發生的時間,格式如:

2017-03-21T20:50:40.130+0800

-Xloggc:/logs/gc.log ?輸出GC日志到文件

歡迎指出本文有誤的地方,轉載請注明原文出處https://my.oschina.net/7001/blog/870988

轉載于:https://my.oschina.net/7001/blog/870988

《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀

總結

以上是生活随笔為你收集整理的GC日志参数详解的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。