Java Jboss-eap-6.3 无法为对象堆保留足够的空间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26356305/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 02:19:50  来源:igfitidea点击:

Jboss-eap-6.3 Could not reserve enough space for object heap

javajboss6.x

提问by java developer

I have Java7 running on 32-bit Windows.
When I am running Jboss-eap-6.3 server, I am getting the following exception repeatedly each time I try to run the program.

我在 32 位 Windows 上运行 Java7。
当我运行 Jboss-eap-6.3 服务器时,每次尝试运行该程序时都会重复出现以下异常。

  • D:\mysoft\jboss-eap-6.3\bin>standalone.bat
  • Calling D:\mysoft\jboss-eap-6.3\bin\standalone.conf.bat
  • Setting JAVA property to C:\Program Files\Java\jdk1.7.0_10\bin\java
  • D:\mysoft\jboss-eap-6.3\bin>standalone.bat
  • 打电话 D:\mysoft\jboss-eap-6.3\bin\standalone.conf.bat
  • 将 JAVA 属性设置为 C:\Program Files\Java\jdk1.7.0_10\bin\java


JBoss Bootstrap Environment
JBOSS_HOME: "D:\mysoft\jboss-eap-6.3"
JAVA: "C:\Program Files\Java\jdk1.7.0_10\bin\java"

JAVA_OPTS: "-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-Tra
ceClassUnloading -client -Dprogram.name=standalone.bat -Xms1G -Xmx1G -XX:MaxPermSize=256M -Djava.net.preferIPv4Stack=true  -Djboss.modules.policy-per
missions=true  -Djboss.modules.system.pkgs=org.jboss.byteman"

...
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.

Can any one help me?

谁能帮我?

采纳答案by Federico Sierra

It's actually a problem with the startup script. Here's the bug for that https://bugzilla.redhat.com/show_bug.cgi?id=956281. The workaround is to remove the perm gensetting from the JAVA_OPTSline:

其实是启动脚本的问题。这是https://bugzilla.redhat.com/show_bug.cgi?id=956281的错误。解决方法是从行中删除perm gen设置JAVA_OPTS

Cause: The max perm gen space parameter is causing the JVM to not be created, which then prevents the server from starting.  This is specifically on Windows 8 32-bit JVM.
Consequence: The server will not start.
Workaround (if any): Remove the -XX:MaxPermSize=256m

回答by Jivi

What is the memory available with your machine? I see the parameters -Xms1G -Xmx1G. This means that your JVM will be started with Xms=1GBamount of memory and will be able to use a maximum of Xmx=1GBamount of memory.

您的机器有多少可用内存?我看到了参数-Xms1G -Xmx1G。这意味着您的 JVM 将以Xms=1GB大量内存启动,并且将能够使用最Xmx=1GB大量的内存。

I think, may be you reduce the amount of memory (like -Xmx2048m -Xms256m).

我想,可能是你减少了内存量(比如-Xmx2048m -Xms256m)。

I hope it helps.

我希望它有帮助。

You can refer to this.

你可以参考这个

回答by java developer

According to the above Federico Sierra answer under jboss-eap-6.3\domain\configurationlocation host.xmlfile is present. In that file I just commented the following line:

根据上面的 Federico Sierra 答案, jboss-eap-6.3\domain\configuration位置host.xml文件下存在。在该文件中,我刚刚评论了以下行:

<permgen size="256m" max-size="256m"/>

It's working. Thanks Federico Sierra.

它正在工作。感谢费德里科·塞拉。

回答by Kushal

You can also resolve this by changing JAVA_OPTS value under standalone.conf.bat.

您也可以通过更改 standalone.conf.bat 下的 JAVA_OPTS 值来解决这个问题。

old

老的

rem # JVM memory allocation pool parameters - modify as appropriate.
set "JAVA_OPTS=-Xms1303M -Xmx1303M -XX:MaxPermSize=256M"

new

新的

set "JAVA_OPTS=-Xms256M -Xmx256M -XX:MaxPermSize=256M"

回答by Dinesh Jr

If it still doesn't work after trying all above options. Go To: jboss-eap-6.4\domain\configuration -> host.xml, and have this size set up

如果尝试上述所有选项后仍然不起作用。转到:jboss-eap-6.4\domain\configuration -> host.xml,并设置这个大小

<heap size="256m" max-size="256m"/>

And also go to: jboss-eap-6.4\standalone\configuration -> standalone.xml, have this size set up

并转到:jboss-eap-6.4\standalone\configuration -> standalone.xml,设置这个大小

set "JAVA_OPTS=-Xms256M -Xmx256M -XX:MaxPermSize=256M"

And now Restart your Eclipse and try Run your Jboss6.1+ server it should be working.

现在重新启动您的 Eclipse 并尝试运行您的 Jboss6.1+ 服务器,它应该可以正常工作。

Also set this in host.xml: <permgen size="256m" max-size="256m"/>Good Luck.

也将其设置为host.xml: <permgen size="256m" max-size="256m"/>“好运”。