我遇到了一个相当混乱的 GC 案例:虽然 Eden 空间 100% 已满,但使用了 0% 幸存者空间。当伊甸园满了,应该触发垃圾收集,对吧?
是否存在阻止 GC 守护进程运行的情况?像 100% 的 CPU?
我们正在使用jdk-1.7
.
可能是什么原因?以下是 jmap 输出。
我们还尝试使用 捕获更详细的内存使用情况jmap -histo -F
,但随后 CPU 使用率降至 0%,java 进程变得无法访问。
using thread-local object allocation.
Parallel GC with 18 thread(s)
Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 12884901888 (12288.0MB)
NewSize = 1310720 (1.25MB)
MaxNewSize = 17592186044415 MB
OldSize = 5439488 (5.1875MB)
NewRatio = 2
SurvivorRatio = 8
PermSize = 21757952 (20.75MB)
MaxPermSize = 85983232 (82.0MB)
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
PS Young Generation
Eden Space:
capacity = 4265738240 (4068.125MB)
used = 4265738240 (4068.125MB)
free = 0 (0.0MB)
100.0% used
From Space:
capacity = 14352384 (13.6875MB)
used = 0 (0.0MB)
free = 14352384 (13.6875MB)
0.0% used
To Space:
capacity = 14680064 (14.0MB)
used = 0 (0.0MB)
free = 14680064 (14.0MB)
0.0% used
PS Old Generation
capacity = 8589934592 (8192.0MB)
used = 8589931920 (8191.997451782227MB)
free = 2672 (0.0025482177734375MB)
99.99996889382601% used
PS Perm Generation
capacity = 41353216 (39.4375MB)
used = 41079056 (39.17604064941406MB)
free = 274160 (0.2614593505859375MB)
99.33702858805468% used