依次执行如下命令
C:\Documents and Settings\pprun>ver
Microsoft Windows XP [版本 5.1.2600]
C:\Documents and Settings\pprun>java -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
C:\Documents and Settings\pprun>java -Xmx
2048m -version
Error occurred during initialization of VM
Could not reserve enough space for object heapCould not create the Java virtual machine.
2 G 内存,很新鲜吗?
我刚加了一条,才百多块。
然而,直到我试到
1446 这个可爱的幸运数字时,才成功:
C:\Documents and Settings\pprun>java -Xmx
1447m -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
C:\Documents and Settings\pprun>java -Xmx
1446m -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode)
我立即切换到 Ubunut8.04,进行了一下测试:
pprun@pprun-t61:~$ uname -r
2.6.24-21-generic
pprun@pprun-t61:~$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 8.04.1
Release: 8.04
Codename: hardy
pprun@pprun-t61:~$ java -Xmx3072m -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)
pprun@pprun-t61:~$ java -Xmx3722m -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)
pprun@pprun-t61:~$ java -Xmx
3723m -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
是不是 JAVA 也赞成 Windows XP 黑屏?
竟然不能够分配超过
1446m (1.446g) 内存堆!