Java 无法为对象堆错误保留足够的空间

2022-01-16 00:00:00 jvm minecraft java

我在 32 位 Windows 和 4 GB RAM 上运行 Java7,但是:

I have Java7 running on 32-bit Windows and 4 GB RAM, but:

java -Xmx4G -Xms4G -jar Minecraft.jar 
java -Xmx3G -Xms3G -jar Minecraft.jar 
java -Xmx2G -Xms2G -jar Minecraft.jar

...还是不行.错误:

...still does not work. Error:

虚拟机初始化过程中发生错误
无法为对象堆保留足够的空间
错误:无法创建 Java 虚拟机.
错误:发生了致命异常.程序将会退出.

Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

java -Xmx1G -Xms1G -jar Minecraft.jar 正在工作.为什么?

推荐答案

转到开始控制面板系统高级系统设置advanced(tab)环境变量系统变量:

Go to StartControl PanelSystemAdvanced system settingsadvanced(tab)Environment VariablesSystem VariablesNew:

Variable name: _JAVA_OPTIONS
Variable value: -Xmx512M

相关文章