开发者

Cannot start JBoss 5 with memory setting -Xmx768M

开发者 https://www.devze.com 2022-12-14 19:40 出处:网络
We have PC with Windows with 2048 RAM. We try to use nex开发者_JAVA百科t memory settings for JBoss:

We have PC with Windows with 2048 RAM.

We try to use nex开发者_JAVA百科t memory settings for JBoss:

-Xms256M -Xmx768M -XX:MaxPermSize=256M

But it cannot start:

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

JBoss starts only if we change -Xmx768M to -Xmx512M.

What can be the problem?

Update: Now we use next settings

-Xms512M -Xmx768M -XX:MaxPermSize=156M


http://javahowto.blogspot.in/2006/06/6-common-errors-in-setting-java-heap.html

The error seems to be saying that the virtual memory size of the machine is smaller than the maximum heap size we are defining via "-Xms1303m -Xmx1303m". I have changed it to "-Xms256m -Xmx512m" and it started working in my local windows box.


Interesting. What happens when you set max memory to 513M?

If that fails, it's possibly a problem I haven't seen in quite a while. An ancient COBOL compiler I used refused to work on PCs with 640K of RAM because they used a signed-number check to decide if there was enough memory.

And in that world, 640K actually had the high bit set, hence was a negative number, so the check always failed.

I find it hard to believe that this would be the case in todays world but it may be worth looking at.

If it doesn't fail at 513M, then it may just be that you're trying to allocate too much memory. It's not necessarily physical memory that matters, address space may be the issue but you should have 2G (at least) of that as well in 32bit Windows.

With your settings shown, you use 1G just for permgen and heap. Try adjusting these until it works and post the figures you have.


There are two possible causes:

  • JVM couldn't find 768 MiB continuous region in the address space or
  • total size of free area on your RAM and paging file is less than 1 GiB.

(JVM checks them using -Xmx and -XX:MaxPermSize on startup because of GC implementation)

As you could -Xmx768m -XX:MaxPermSize156m, the latter is doubtful.

If so, the problem might be resolved by freeing RAM (e.g., stopping unused services) or extending paging file.


maybe you can reboot your pc and try again. you can't allocation the memory more than your total physical memory.


-Xms256M -Xmx768M -XX:MaxPermSize=256M should only be trying to grab 512M at most on initialization plus about 100M for the JVM process itself. Do you have that much free memory on the machine? We always run jboss on machines with 4G because the DB takes up quite a bit as well.

Here's a trick you can use to find the max amount you can set. You can simply run

java -version -Xms256M -Xmx768M -XX:MaxPermSize=256M

And then increase/decrease values until you find the max the JVM will let you set.

BTW, on a 4G 32-bit windows box, we usually set -Xms768M -Xmx1300M -XX:MaxPermSize=256M

0

精彩评论

暂无评论...
验证码 换一张
取 消