一个小gc需要超过35秒,可能是什么问题? 以下是选项:
Memory: 4k page, physical 264663756k(37815144k free), swap 0k(0k free)
CommandLine flags:
-XX:-BytecodeVerificationLocal
-XX:-BytecodeVerificationRemote
-XX:InitialHeapSize=2147483648
-XX:MaxHeapSize=2147483648
-XX:MaxNewSize=715829248
-XX:MaxPermSize=1073741824
-XX:MaxTenuringThreshold=6
-XX:NewSize=715829248
-XX:OldPLABSize=16
-XX:OldSize=1431654400
-XX:ParGCCardsPerStrideChunk=4096
-XX:PrintCMSStatistics=2
-XX:PrintFLSStatistics=2
-XX:+PrintGC
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintHeapAtGC
-XX:+PrintTenuringDistribution
-XX:+TraceClassLoading
-XX:+TraceClassUnloading
-XX:+UseCompressedClassPointers
-XX:+UseCompressedOops
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
这是gc log:
{Heap before GC invocations=18 (full 4):
par new generation total 629120K, used 629120K [0x0000000080000000, 0x00000000a2220000, 0x00000000a2220000) [0x00000000a2220000, 0x00000000a6660000, 0x00000000a6660000) [0x00000000a6660000, 0x00000000aaaa0000, 0x00000000aaaa0000)
eden space 559232K, 100% used [0x0000000080000000, 0x00000000a2220000, 0x00000000a2220000)
from space 69888K, 100% used [0x00000000a6660000, 0x00000000aaaa0000, 0x00000000aaaa0000)
to space 69888K, 0% used [0x00000000a2220000, 0x00000000a2220000, 0x00000000a6660000)
concurrent mark-sweep generation total 1398144K, used 401822K [0x00000000aaaa0000, 0x0000000100000000, 0x0000000100000000)
Metaspace used 342699K, capacity 345066K, committed 346152K, reserved 1349632K
data space used 296990K, capacity 298882K, committed 299880K, reserved 301056K
class space used 45708K, capacity 46184K, committed 46272K, reserved 1048576K
2016-06-29T10:38:24.859-0700: 224.111: [GC (Allocation Failure) Before GC:
Statistics for BinaryTreeDictionary:
------------------------------------
Total Free Space: 126686341
Max Chunk Size: 126686341
Number of Blocks: 1
Av. Block Size: 126686341
Tree Height: 1
Statistics for IndexedFreeLists:
--------------------------------
Total Free Space: 826411
Max Chunk Size: 256
Number of Blocks: 44150
Av. Block Size: 18
free=127512752 frag=0.0129
2016-06-29T10:38:24.860-0700: 224.111: [ParNew
Desired survivor size 35782656 bytes, new threshold 1 (max 6)
- age 1: 38199288 bytes, 38199288 total
: 629120K->69888K(629120K), 35.1522432 secs] 1030942K->541424K(2027264K)After GC:
Statistics for BinaryTreeDictionary:
------------------------------------
Total Free Space: 117783972
Max Chunk Size: 117783972
Number of Blocks: 1
Av. Block Size: 117783972
Tree Height: 1
Statistics for IndexedFreeLists:
--------------------------------
Total Free Space: 805466
Max Chunk Size: 256
Number of Blocks: 38431
Av. Block Size: 20
free=118589438 frag=0.0135
, 35.1524542 secs] [Times: user=6.53 sys=23.78, real=35.16 secs]
Heap after GC invocations=19 (full 4):
par new generation total 629120K, used 69888K [0x0000000080000000, 0x00000000a2220000, 0x00000000a2220000) [0x00000000a2220000, 0x00000000a6660000, 0x00000000a6660000) [0x00000000a6660000, 0x00000000aaaa0000, 0x00000000aaaa0000)
eden space 559232K, 0% used [0x0000000080000000, 0x0000000080000000, 0x00000000a2220000)
from space 69888K, 100% used [0x00000000a2220000, 0x00000000a6660000, 0x00000000a6660000)
to space 69888K, 0% used [0x00000000a6660000, 0x00000000a6660000, 0x00000000aaaa0000)
concurrent mark-sweep generation total 1398144K, used 471536K [0x00000000aaaa0000, 0x0000000100000000, 0x0000000100000000)
Metaspace used 342699K, capacity 345066K, committed 346152K, reserved 1349632K
data space used 296990K, capacity 298882K, committed 299880K, reserved 301056K
class space used 45708K, capacity 46184K, committed 46272K, reserved 1048576K
}