JBoss6 fails to start on Windows (32bit) machine with JDK 7

JBoss will not start with my current configuration. I receive the error:

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. Press any key to continue . . .

The JAVA_OPTS being used by JBoss are:

-client 
-Dprogram.name=standalone.bat 
-Xms128 
-Xmx2G 
-XX:MaxPermSize=256M 
-Djava.net.preferIPv4Stack=true 
-Djboss.modules.system.pkgs=org.jboss.byteman 
-Xms1024m 
-Xmx2048m 
-XX:PermSize=32m 
-XX:MaxPermSize=512m 
-Xss2m 
-XX:+UseConcMarkSweepGC 
-XX:+CMSClassUnloadingEnabled 
-Djavax.xml.soap.MessageFactory=org.apache.axis.soap.MessageFactoryImpl 
-Djavax.xml.soap.SOAPConnectionFactory=org.apache.axis.soap.SOAPConnectionFactor‌​yImpl 
-Djavax.xml.soap.SOAPFactory=org.apache.axis.soap.SOAPFactoryImpl"

From the JAVA_OPTS you're setting the maximum heap to 2048m (2G) which won't work on a Win32 - it's the -Xmx2048m option that controls this (which seems to be being set twice).

To run on a Win32 you should adjust the -Xms and -Xmx options. On a vanilla JBoss installation (well on my JBoss installation at least) both options are set in standalone.conf.bat . Try setting both to 1024m to start with and reduce if you're still having problems.

It's also likely that you'll want to turn down the -XX:MaxPermSize (which again is being set twice). 256m may work but if not try using 128m .


To reuse portions of this answer of mine (about Tomcat, but applies to JBoss or any Java process):

The Windows OS limits the memory allocation of a 32-bit process to 2 GiB in total (by default).

[You will only be able] to allocate around 1.5 GiB heap space because there is also other memory allocated to the process (the JVM / library overhead, perm gen space etc.).

Why does 32-bit Windows impose a 2 GB process address space limit, but 64-bit Windows impose a 4GB limit?

Other modern operating systems [cough Linux] allow 32-bit processes to use all (or most) of the 4 GiB addressable space.

That said, 64-bit Windows OS's can be configured to increase the limit of 32-bit processes to 4 GiB (3 GiB on 32-bit):

http://msdn.microsoft.com/en-us/library/windows/desktop/aa366778(v=vs.85).aspx

However [as others have stated], the best solution is to use a 64-bit JVM with your 64-bit OS. Terabyte heaps anyone? :D

So, you won't be able to set -Xmx2048m in your Java opts, but -Xmx1024m will work - as should a value approaching 1.5 GiB (but the exact figure varies).


You should use 64-bit OS. you will face a lot of problems with 32-bit OS while working on jboss6, jdk1.7 etc...

链接地址: http://www.djcxy.com/p/82962.html

上一篇: elasticsearch安装插件:无法为对象堆预留足够的空间

下一篇: JBoss6无法在带有JDK 7的Windows(32位)机器上启动