Ich setze -Xmn1m -XX:SurvivorRatio=2
, erwarte, eden Raum zu 512K zu sehen, aber tatsächlich ist es 0K.Warum -Xmn1m -XX: SurvivorRatio = 2 macht eden Raum 0k
Es ist wirklich seltsam und ich weiß nicht warum. Ich brauche deine Hilfe.
vm Optionen: -Xmx20m -Xms20m -Xmn1m -XX: SurvivorRatio = 2 -XX: + PrintGCDetails
Java-Version: 1.7.0_79
Code und Ergebnis ist wie folgt:
public class NewSizeDemo {
public static void main(String[] args){
byte[] b = null;
for (int i=0; i<10; i++){
b = new byte[1*1024*1024];
}
}
}
Heap
PSYoungGen total 512K, used 0K [0x00000007fff00000, 0x0000000800000000, 0x0000000800000000)
eden space 0K, -2147483648% used [0x00000007fff00000,0x00000007fff00000,0x00000007fff00000)
from space 512K, 0% used [0x00000007fff80000,0x00000007fff80000,0x0000000800000000)
to space 512K, 0% used [0x00000007fff00000,0x00000007fff00000,0x00000007fff80000)
ParOldGen total 19456K, used 11573K [0x00000007fec00000, 0x00000007fff00000, 0x00000007fff00000)
object space 19456K, 59% used [0x00000007fec00000,0x00000007ff74d5a0,0x00000007fff00000)
PSPermGen total 21504K, used 2996K [0x00000007f9a00000, 0x00000007faf00000, 0x00000007fec00000)
object space 21504K, 13% used [0x00000007f9a00000,0x00000007
irgendwie im Zusammenhang denke ich: https://www.google.com/url?sa=t&source=web&rct=j&url=https://stackoverflow.com/questions/43798527/hotsot-jvm-options&ved=0ahUKEwiz4IyYqbLXAhUCCewKHYOnAokQjjgIIjAA&usg= AOvVaw0D3I5GbJFe9_6olMMqlaRK – Eugene