简体   繁体   English

VM 初始化过程中发生错误 无法为对象堆保留足够的空间 无法创建 Java 虚拟机

[英]Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine

I am facing this problem since more than a month, here is what I see when I run java on command line:一个多月以来我一直面临这个问题,这是我在命令行上运行 java 时看到的:

$ java -Xmx1300m 
Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine.

If I run with less memory it works fine如果我以较少的内存运行它就可以正常工作

$ java -Xmx1240m Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file) ..... .....

I spent a week trying to debug this and nothing worked.我花了一个星期试图调试它,但没有任何效果。 Finally I had my IT support guys replace the laptop.最后我让我的 IT 支持人员更换了笔记本电脑。 This happened a month ago on 10/23.这发生在一个月前的 10/23。 Now, after a month, the same problem is back on my new system.现在,一个月后,同样的问题又出现在我的新系统上。

My system configuration is:我的系统配置是:

Win 7 Enterprise (64-bit), Service Pack 1. Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz 8.00 GB RAM Win 7 Enterprise(64 位),Service Pack 1。Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz 8.00 GB RAM

Java: java version "1.5.0_20" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_20-b02) Java HotSpot(TM) Client VM (build 1.5.0_20-b02, mixed mode)

We are a team of about 30 guys here and I am the only one facing this.我们是一支大约 30 人的团队,我是唯一一个面临这种情况的人。 All others have almost the same config and working fine for them.所有其他人都有几乎相同的配置并且对他们来说工作正常。

An important observation is Java works fine for some time and then this problem appears once it appears it doesn't go away, even if I re-install java.一个重要的观察结果是 Java 可以正常工作一段时间,然后这个问题一旦出现就出现了,即使我重新安装了 java。

I faced this issue the 3rd time after the IT support guys re-imaged by laptop.在 IT 支持人员通过笔记本电脑重新成像后,我第三次遇到了这个问题。 It worked for a month and now the same problem is back.它工作了一个月,现在同样的问题又回来了。

Everybody is completely clueless.每个人都完全没有头绪。 I have started using 2 laptops now.我现在已经开始使用 2 台笔记本电脑了。 :-) :-)

Anyway, here is how to fix it:无论如何,这是修复它的方法:

Go to Start->Control Panel->System->Advanced(tab)->Environment Variables->System Variables->New:转到开始->控制面板->系统->高级(选项卡)->环境变量->系统变量->新建:

Variable name: _JAVA_OPTIONS变量名:_JAVA_OPTIONS

Variable value: -Xmx512M变量值:-Xmx512M

taken from this link取自此链接

Eureka !尤里卡! Finally I found a solution on this.最后我找到了解决方案。

This is caused by Windows update that stops any 32-bit processes from consuming more than 1200 MB on a 64-bit machine.这是由阻止任何 32 位进程在 64 位计算机上消耗超过 1200 MB 的 Windows 更新引起的。 The only way you can repair this is by using the System Restore option on Win 7.修复此问题的唯一方法是使用 Win 7 上的系统还原选项。

Start >> All Programs >> Accessories >> System Tools >> System Restore.开始>>所有程序>>附件>>系统工具>>系统还原。

And then restore to a date on which your Java worked fine.然后恢复到您的 Java 工作正常的日期。 This worked for me.这对我有用。 What is surprising here is Windows still pushes system updates under the name of "Critical Updates" even when you disable all windows updates.令人惊讶的是,即使您禁用了所有 Windows 更新,Windows 仍会以“关键更新”的名义推送系统更新。 ^& %)# * Windows :-) ^& %)# * 视窗 :-)

This might also occur if you are running on 64-bit Machine with 32-bit JVM (JDK), switch it to 64-bit JVM.如果您在具有 32 位 JVM (JDK) 的 64 位机器上运行,也可能会发生这种情况,请将其切换到 64 位 JVM。 Check your (Right Click on My Computer --> Properties) Control Panel\\System and Security\\System --> Advanced System Settings -->Advanced Tab--> Environment Variables --> JAVA_HOME...检查您的(右键单击我的电脑--> 属性)控制面板\\系统和安全\\系统--> 高级系统设置--> 高级选项卡--> 环境变量--> JAVA_HOME...

谢谢。我将堆空间从 2000MB 更改为 1024MB 并且它起作用了...

I've just seen this problem myself, Jboss AS7 with jdk1.5.0_09.我自己刚刚看到这个问题,Jboss AS7 with jdk1.5.0_09。 Update System Property JAVA_HOME to jdk1.7+ to fix (I'm using jdk1.7.0_67).将系统属性 JAVA_HOME 更新为 jdk1.7+ 以修复(我使用的是 jdk1.7.0_67)。

If your computer is a 64bit, all you need to do is uninstall your Java x86 version and install a 64bit version.如果您的计算机是 64 位,您需要做的就是卸载 Java x86 版本并安装 64 位版本。 I had the same problem and this worked.我有同样的问题,这奏效了。 Nothing further needs to be done.无需进一步操作。

您可以在 _JAVA_OPTIONS 中更新用户路径:-Xmx512M 路径:C:\\Program Files (x86)\\Java\\jdk1.8.0_231\\bin;C:\\Program Files(x86)\\Java\\jdk1.8.0_231\\jre \\bin 现在它正在工作 //

Sometimes it may happen that you run multiple applications on the same java VM.有时可能会在同一个 Java VM 上运行多个应用程序。 In Case you have tried all the other solutions described above and it didnt work.如果您已经尝试了上述所有其他解决方案,但没有奏效。 Try Running your process by running it on a newly created java VM by passing vmargs尝试通过传递 vmargs 在新创建的 java VM 上运行您的进程

-agentlib:jdwp=transport=dt_socket,server=y,address=10049,suspend=n . 

Here address is what the vm takes.这里的地址是 vm 需要的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 VM初始化期间发生错误; 无法为对象堆保留足够的空间; 无法创建Java虚拟机 - Error occurred during initialization of VM; Could not reserve enough space for object heap; Could not create the Java virtual machine VM初始化期间发生Java错误无法为对象堆保留足够的空间 - Java Error occurred during initialization of VM Could not reserve enough space for object heap “虚拟机初始化时出错; 无法为对象堆保留足够的空间”使用 -Xmx3G - “Error occurred during initialization of VM; Could not reserve enough space for object heap” using -Xmx3G VM 初始化时出错 无法为 object 堆 Android Studio 保留足够的空间 - Error occurred during initialization of VM Could not reserve enough space for object heap Android Studio 初始化 VM 时出错,无法为 object 堆预留足够的空间 - Error occurred during initialization of VM, Could not reserve enough space for object heap 解决方法:“ VM初始化期间发生错误; 无法为对象堆保留足够的空间” - How to resolve this : “Error occurred during initialization of VM; Could not reserve enough space for object heap” VM初始化期间发生错误,无法为对象堆保留足够的空间 - Error occurred during initialization of VM Could not reserve enough space for object heap “ VM初始化期间发生错误,无法为1048576KB对象堆保留足够的空间” - “Error occurred during initialization of VM Could not reserve enough space for 1048576KB object heap” 初始化VM时出错,无法为对象堆保留足够的空间 - Spring Tool Suite? - Error occured during initialization of VM, Could not reserve enough space for object heap - Spring Tool Suite? VM初始化期间发生错误:无法为对象堆保留足够的空间 - Error occured during initialization of VM: Could not reserve enough space for object heap
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM