參數:-Xmx20m -Xms20m -XX:NewRatio=1 -XX:SurvivorRatio=2 -XX:+PrintGCDetails -XX:PermSize=2mspa
結果:io
Heap
PSYoungGen total 7680K, used 3697K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)
eden space 5120K, 41% used [0x00000000ff600000,0x00000000ff8167c8,0x00000000ffb00000)
from space 2560K, 60% used [0x00000000ffd80000,0x00000000fff06020,0x0000000100000000)
to space 2560K, 0% used [0x00000000ffb00000,0x00000000ffb00000,0x00000000ffd80000)
ParOldGen total 10240K, used 0K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)
object space 10240K, 0% used [0x00000000fec00000,0x00000000fec00000,0x00000000ff600000)
PSPermGen total 2560K, used 2546K [0x00000000f9a00000, 0x00000000f9c80000, 0x00000000fec00000)
object space 2560K, 99% used [0x00000000f9a00000,0x00000000f9c7c818,0x00000000f9c80000)sed
猜論:object
一、PSYoungGen total 爲7680k,等於一個eden space(5210k)和from space(2560k)之和,to space(2560k)是不計入YoungGen中的di
換句話說,年輕代的實際總大小須要減去一個倖存代vi
二、NewRadio=1 ,年輕代和年老代1:1平分20M,各佔10240k參數
三、PermSize不說了,這個差點就溢出了
四、SurvivorRadio=2 這個就是 eden:from:to=2:1:1,而後結果就是:5120k:2560K:2560K