應用啓動FGC頻繁問題排查

現象

  應用剛啓動的幾分鐘內固定的發生3次FGC,之後平穩不再GC;

GC日誌分析

  從GC日誌可以看出,Metaspace容量達到上限分別觸發了一次YGC和FGC,而且Metaspace容量的容量在變大這說明Metaspace容量在不斷擴容,這說明Metaspace容量設置過小導致應用啓動時發生了擴容,查看JVM參數發現沒有顯式指定Metaspace容量,默認爲20M;
在這裏插入圖片描述

GCeasy可視化分析

  GCeasy的分析結果如下,可以看出Metadata GC耗時嚴重,給出的修改建議也是-XX:MetaspaceSize配置Metaspace容量;
在這裏插入圖片描述
在這裏插入圖片描述

名詞解釋

  • Metadata GC Threshold:This GC is triggered when Metaspace got filled up and JVM wants to create new objects in this space(Metaspace的容量達到設定的閾值,導致觸發GC);
  • Allocation Failure:Allocation Failure happens when there isn’t enough free space to create new objects in Young generation. Allocation failures triggers Young GC. On Linux, the JVM can trigger a GC if the kernel notifies there isn’t much memory left via mem_notify(Young區空間不足導致對象分配失敗觸發YGC);

參考:

  1. gceasy網址:https://gceasy.io/diamondgc-report.jsp?oTxnId_value=f3d059e4-fd71-402c-a1a6-f4e7ce33c491
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章