簡體   English   中英

Java 11 - G1GC - 需要了解年輕代 gc 日志及其對應用程序線程的影響

[英]Java 11 - G1GC - Need to understand young generation gc logs and their effect on application threads

我正在運行啟用了 G1GC 的 java 應用程序,我正在打印 gc 日志,如下所示:

[4074.182s][info][gc] GC(1017) Pause Young (Normal) (G1 Evacuation Pause) 6869M->6115M(16384M) 7430.860ms
[4082.328s][info][gc] GC(1018) Pause Young (Normal) (G1 Evacuation Pause) 6875M->6121M(16384M) 7058.485ms
[4089.592s][info][gc] GC(1019) Pause Young (Normal) (G1 Evacuation Pause) 6881M->6126M(16384M) 6172.693ms
[4105.799s][info][gc] GC(1021) Pause Young (Normal) (G1 Evacuation Pause) 6892M->6137M(16384M) 6845.922ms
[4114.418s][info][gc] GC(1022) Pause Young (Normal) (G1 Evacuation Pause) 6897M->6142M(16384M) 7563.613ms
[4122.805s][info][gc] GC(1023) Pause Young (Normal) (G1 Evacuation Pause) 6902M->6148M(16384M) 7326.923ms
[4131.270s][info][gc] GC(1024) Pause Young (Normal) (G1 Evacuation Pause) 6908M->6155M(16384M) 7402.222ms
[4140.574s][info][gc] GC(1025) Pause Young (Normal) (G1 Evacuation Pause) 6915M->6161M(16384M) 8226.283ms
[4149.429s][info][gc] GC(1026) Pause Young (Normal) (G1 Evacuation Pause) 6921M->6167M(16384M) 7779.282ms
[4157.078s][info][gc] GC(1027) Pause Young (Normal) (G1 Evacuation Pause) 6927M->6172M(16384M) 6559.166ms

我對這個日志的理解是:

[4074.182s][info][gc] GC(1017) Pause Young (Normal) (G1 Evacuation Pause) 6869M->6115M(16384M) 7430.860ms

As per my understanding this shows that 4074.182 seconds after application started, a young generation 
Stop the world gc was kicked in, and heap size before gc heap size was 6869M 
and after gc it reduced to 6115M and it took 7430.860ms (more than 7 seconds).

我的問題:

1. Is this young gc stopping all the application threads ?
2. If it is stopping all the application threads then looks like application is not 
   running at all during all these gc logs were printed because:
    after [4074.182s] young gc kicked in and it took aroung 7.5 seconds (7430.860ms)
    after ~8 seconds, [4082.328s] yound gc kicked in again and took around 7 seonds and so on.
   So it looks like application is not getting any free slot here to run ?  

是的,你的應用程序被停止了,所有的線程在這期間都被暫停了。 有趣的是,GC 只能在大約 6-7 秒內回收大約700MB ,這絕對是糟糕的。 沒有調試消息,就不可能說出為什么會這樣,可能是機器上啟動了線程,可能是區域之間的連接太多,因此掃描記憶集花費了很多時間,或者任何其他原因。

但最重要的是,在這些周期中,您的應用程序表現非常糟糕; 你說對了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM