轉載自 這裡
前言 :
在Javaworld上面看到一篇文章请教高手:Tomact内存设置1.5G不能启动,裡面提到可以用
java -XmxXXXXM -version 指令來測試JVM最大的記憶體設定,經過我自己在CentOS 4.4 Linux上面測試後發現JDK 6.0可以支援到2690M
測試 :
$ java -Xmx2690M -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
$ java -Xmx2691M -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
但是如果再加上-server參數,則可以再往上擠出10M,達到2700M :
$ java -server -Xmx2700M -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)
$ java -server -Xmx2701M -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
前言 :
在Javaworld上面看到一篇文章请教高手:Tomact内存设置1.5G不能启动,裡面提到可以用
java -XmxXXXXM -version 指令來測試JVM最大的記憶體設定,經過我自己在CentOS 4.4 Linux上面測試後發現JDK 6.0可以支援到2690M
測試 :
$ java -Xmx2690M -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
$ java -Xmx2691M -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
但是如果再加上-server參數,則可以再往上擠出10M,達到2700M :
$ java -server -Xmx2700M -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)
$ java -server -Xmx2701M -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
This message was edited 4 times. Last update was at 09/05/2012 14:51:53
沒有留言:
張貼留言