1.JVM 参数设置
-Xms50m -Xmx50m -Xmn10m -XX:SurvivorRatio=8
2.打印结果:
Heap
PSYoungGen total 9216K, used 6460K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)
eden space 8192K, 78% used [0x00000000ff600000,0x00000000ffc4f208,0x00000000ffe00000)
from space 1024K, 0% used [0x00000000fff00000,0x00000000fff00000,0x0000000100000000)
to space 1024K, 0% used [0x00000000ffe00000,0x00000000ffe00000,0x00000000fff00000)
ParOldGen total 40960K, used 31546K [0x00000000fce00000, 0x00000000ff600000, 0x00000000ff600000)
object space 40960K, 77% used [0x00000000fce00000,0x00000000feccea78,0x00000000ff600000)
Metaspace used 3514K, capacity 4498K, committed 4864K, reserved 1056768K
class space used 387K, capacity 390K, committed 512K, reserved 1048576K
可以看到 老年代是40m
2. 当JVM 参数
-Xms51m -Xmx51m -Xmn10m -XX:SurvivorRatio=8
GC打印结果:
Heap
PSYoungGen total 9216K, used 6508K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)
eden space 8192K, 77% used [0x00000000ff600000,0x00000000ffc3b100,0x00000000ffe00000)
from space 1024K, 12% used [0x00000000fff00000,0x00000000fff20000,0x0000000100000000)
to space 1024K, 0% used [0x00000000ffe00000,0x00000000ffe00000,0x00000000fff00000)
ParOldGen total 43008K, used 31535K [0x00000000fcc00000, 0x00000000ff600000, 0x00000000ff600000)
object space 43008K, 73% used [0x00000000fcc00000,0x00000000feacbfb8,0x00000000ff600000)
Metaspace used 3524K, capacity 4498K, committed 4864K, reserved 1056768K
class space used 387K, capacity 390K, committed 512K, reserved 1048576K
这里年老代为什么 是42m?不应该是41m吗?