gc.log显示Prepare TLABs阶段花费了大约 57 秒,这是不可接受的。而且,这种情况五天才发生一次。我只想弄清楚究竟发生了什么以及如何避免。
[gc.log]
[2021-08-02T11:38:38.134+0800][322490.377s][161325][safepoint ] Entering safepoint region: G1CollectForAllocation
[2021-08-02T11:38:38.134+0800][322490.378s][161325][gc,start ] GC(238) Pause Young (Normal) (G1 Evacuation Pause)
[2021-08-02T11:38:38.134+0800][322490.378s][161325][gc,task ] GC(238) Using 18 workers of 18 for evacuation
[2021-08-02T11:39:35.179+0800][322547.422s][161325][gc,phases ] GC(238) Pre Evacuate Collection Set: 0.1ms
[2021-08-02T11:39:35.179+0800][322547.422s][161325][gc,phases ] GC(238) Prepare TLABs: 57039.1ms
[2021-08-02T11:39:35.179+0800][322547.422s][161325][gc,phases ] GC(238) Choose Collection Set: 0.0ms
[2021-08-02T11:39:35.179+0800][322547.422s][161325][gc,phases ] GC(238) Humongous Register: 0.1ms
[2021-08-02T11:39:35.179+0800][322547.422s][161325][gc,phases ] GC(238) Evacuate Collection Set: 3.8ms
[2021-08-02T11:39:35.179+0800][322547.422s][161325][gc,phases ] GC(238) Ext Root Scanning (ms): Min: 0.0, Avg: 0.4, Max: 3.5, …Run Code Online (Sandbox Code Playgroud)