用 java -XmxXXXXM -version 测试你的机器可用多少内存
如java -Xmx1024M -version
当内存大于可用内存后,将会报错
C:\Users\Administrator>java -Xmx2024M -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.