正撸着代码,内部聊天工具弹出一条信息:
“狼哥,我这个机器总是频繁FGC...快帮我看看”
我打开对话框,机智的回复一个表情
继续默默撸码
随后,小伙伴砸了一段GC日志过来
2019-09-17T20:33:57.889+0800: 4753520.554: [Full GC (Metadata GC Threshold) 4753520.554: [CMS[YG occupancy: 723220 K (1887488 K)]4753520.988: [weak refs process ing, 0.0042134 secs]4753520.992: [class unloading, 0.0987343 secs]4753521.091: [scrub symbol table, 0.0237609 secs]4753521.115: [scrub string table, 0.0025983 s ecs]: 145423K->141376K(3354624K), 0.6260023 secs] 868644K->864597K(5242112K), [Metaspace: 128179K->128179K(1234944K)], 0.6264315 secs] [Times: user=1.24 sys=0.0 0, real=0.63 secs]4159962 Heap after GC invocations=8029 (full 50):4159963 par new generation total 1887488K, used 723220K [0x0000000673400000, 0x00000006f3400000, 0x00000006f3400000)4159964 eden space 1677824K, 42% used [0x0000000673400000, 0x000000069ed59090, 0x00000006d9a80000)4159965 from space 209664K, 4% used [0x00000006d9a80000, 0x00000006da36c210, 0x00000006e6740000)4159966 to space 209664K, 0% used [0x00000006e6740000, 0x00000006e6740000, 0x00000006f3400000)4159967 concurrent mark-sweep generation total 3354624K, used 141376K [0x00000006f3400000, 0x00000007c0000000, 0x00000007c0000000)4159968 Metaspace used 128145K, capacity 136860K, committed 262144K, reserved 1234944K4159969 class space used 14443K, capacity 16168K, committed 77312K, reserved 1048576K4159970 }4159971 {Heap before GC invocations=8029 (full 50):4159972 par new generation total 1887488K, used 723220K [0x0000000673400000, 0x00000006f3400000, 0x00000006f3400000)4159973 eden space 1677824K, 42% used [0x0000000673400000, 0x000000069ed59090, 0x00000006d9a80000)4159974 from space 209664K, 4% used [0x00000006d9a80000, 0x00000006da36c210, 0x00000006e6740000)4159975 to space 209664K, 0% used [0x00000006e6740000, 0x00000006e6740000, 0x00000006f3400000)4159976 concurrent mark-sweep generation total 3354624K, used 141376K [0x00000006f3400000, 0x00000007c0000000, 0x00000007c0000000)4159977 Metaspace used 128145K, capacity 136860K, committed 262144K, reserved 1234944K4159978 class space used 14443K, capacity 16168K, committed 77312K, reserved 1048576K
我这慧眼一瞧,看到了几个关键单词 FullGC
、 MetadataGCThreshold
,然后很随意的回复了
“是不是metaspace没有设置,或者设置太小,导致的FGC
来源:oschina
链接:https://my.oschina.net/u/4277473/blog/4793767