在命令行下用 java -Xmx512M -version 命令来进行测试,然后逐渐的增大512的值,如果执行正常就表示指定的内存大小可用,否则会打印错误信息。
错误提示:
Invalid maximum heap size: -Xmx11512m
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.
正确提示:
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)