我有一个2GB作为堆大小的服务器。当我从jstat收集JVM内存统计信息时,我发现次要GC几乎每隔一秒或每隔一秒发生一次。然后我看作jmap -heap输出,幸存者比率设置为8,伊甸园空间看起来是682.5MB,这是正确的newRatio = 2。 根据我的计算,如果2GB堆的幸存率为8,则S0C和S1C应为68MB左右,但jmap输出仅显示1.5MB。 有人可以解释为什么会发生这种情况
这是我的jmap -heap输出。
Heap Configuration:
MinHeapFreeRatio = 0
MaxHeapFreeRatio = 100
MaxHeapSize = 2147483648 (2048.0MB)
NewSize = 715653120 (682.5MB)
MaxNewSize = 715653120 (682.5MB)
OldSize = 1431830528 (1365.5MB)
NewRatio = 2
SurvivorRatio = 8
MetaspaceSize = 21807104 (20.796875MB)
CompressedClassSpaceSize = 1073741824 (1024.0MB)
MaxMetaspaceSize = 17592186044415 MB
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
PS Young Generation
Eden Space:
capacity = 712507392 (679.5MB)
used = 477707104 (455.5769958496094MB)
free = 234800288 (223.92300415039062MB)
67.0459155039896% used
From Space:
capacity = 1572864 (1.5MB) ------ S0C
used = 786432 (0.75MB)
free = 786432 (0.75MB)
50.0% used
To Space:
capacity = 1572864 (1.5MB) ------ S1C
used = 0 (0.0MB)
free = 1572864 (1.5MB)
0.0% used
PS Old Generation
capacity = 1431830528 (1365.5MB)
used = 779522880 (743.4109497070312MB)
free = 652307648 (622.0890502929688MB)
54.442398367413496% used