• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JBoss AS 7: not starting because of memory?

 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just installed JBoss AS 7 onto Debian and launched it:

vz227:/usr/local/jbossas7# bin/standalone.sh
=========================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /usr/local/jbossas7

JAVA: java

JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman

=========================================================================

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

Hmm, out of memory. I then checked:


Shouldn't that be enough to create the VM?

Karsten
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

JAVA: java


What value have you set for JAVA_HOME? Post the output of:


 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No value at all. Is it mandatory to set it? I tried to set it to /usr/bin/java, then standalone.sh would fail on line 135

"./standalone.sh: line 135: /usr/bin/java/bin/java: Ist kein Verzeichnis"

... is not a directory. True, it doesn't exist. Instead trying JAVA_HOME=/usr fails with the same error as in my OP.

What next? I tried -Xmx256m, that worked for now, but I'd really like to know why -Xmx512m isn't enough when I have 639 MB free. Is it because the perm size must be added to that value? Anything else hidden?

Karsten
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes JAVA_HOME is necessary. What do you have in /usr/lib/jvm/? On my system that's where the default installation of JDK happens. You'll have to find where Java is installed and point JAVA_HOME to it.
 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK I set JAVA_HOME in ~/.bash_profile and it shows up.

When starting the server with the -Xmx512m I get the very same error as in my OP. (I did relogon!)

Karsten
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not have enough memory to run with that heap and permgen sizesize. Add the two up and you have 768MB, yet you show only 639MB of free space. And that does not even count all of the other memory that the JVM needs to run.

Try decreasing both the permgen and the max heap size.
 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what I thought: max + perm space, I wonder where such facts can be found...

So I'll have to do some math now, how to split up the ~640MB that I have left.

320 + 256 = 576 MB + small buffer, or should I do 384 + 192 perm or 320 + 192 perm. I'll just try I guess.

Thanks
Karsten
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best way to size the heap is to monitor it usage and size accordingly. JBoss in Action provides a lot of details about that (the performance tuning chapter is applicable even to JBoss AS 7). Much of the same information can be found in my CMG whitepapers:

Java Garbage Collection Statistical Analysis 101
Java Garbage Collection Performance Analysis 201
at http://www.cmg.org/cgi-bin/search.cgi?q=java+peter+johnson&x=30&y=10
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic