为什么总是"GC(分配失败)"?
用于linux-amd64 JRE(1.8.0_25 -b17)的Java HotSpot(TM)64位服务器VM(25.25- b02),
CommandLine flags:
-XX:CMSInitiatingOccupancyFraction=60
-XX:GCLogFileSize=10485760
-XX:+HeapDumpOnOutOfMemoryError
-XX:InitialHeapSize=32212254720
-XX:MaxHeapSize=32212254720
-XX:NewRatio=10
-XX:OldPLABSize=16
-XX:ParallelGCThreads=4
-XX:+PrintGC
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintStringTableStatistics
-XX:+PrintTenuringDistribution
-XX:StringTableSize=1000003
-XX:SurvivorRatio=4
-XX:TargetSurvivorRatio=50
-XX:+UseCompressedClassPointers
-XX:+UseCompressedOops
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
Run Code Online (Sandbox Code Playgroud)
27.329: [GC (Allocation Failure) 27.329: [ParNew
Desired survivor size 44728320 bytes, new threshold 15 (max 15)
- age 1: 16885304 bytes, 16885304 total
: 349568K->16618K(436928K), 0.2069129 secs] 349568K->16618K(31369920K), 0.2070712 secs] [Times: user=0.78 sys=0.04, real=0.21 secs]
28.210: [GC (Allocation Failure) 28.210: [ParNew
Desired survivor size 44728320 bytes, new threshold 15 (max 15) …Run Code Online (Sandbox Code Playgroud) 我已经将java配置为将垃圾收集信息转储到日志中(详细GC).我不确定日志中的垃圾收集条目是什么意思.这些条目的样本发布在下面.我在Google上搜索过,并没有找到可靠的解释.
我有一些合理的猜测,但我正在寻找答案,这些答案提供了条目中数字的严格定义,并由可靠的消息来源支持.对所有引用sun文档的答案自动+1.我的问题是:
8109.128:[GC [PSYoungGen:109884K-> 14201K(139904K)] 691015K-> 595332K(1119040K),0.0454530秒]
8112.111:[GC [PSYoungGen:126649K-> 15528K(142336K)] 707780K-> 605892K(1121472K),0.0934560 secs]
8112.802:[GC [PSYoungGen:130344K-> 3732K(118592K)] 720708K-> 607895K(1097728K),0.0682690 secs]