roy
roy

Reputation: 33

Jboss memory problem

I am facing "Out Of Memory Error Exception" while running a web service application over jboss 4.2 how can I increase the memory of jboss ? and will this solve the problem ?

Upvotes: 0

Views: 9626

Answers (2)

Enno Shioji
Enno Shioji

Reputation: 26882

You should first confirm if the memory usage is not abnormal. If it is not, it is probably a good idea to increase the memory allocation. JBoss default memory allocation is rather small at the default setting.

You want to confirm that the memory shortage is heap shortage (it could be permgen etc. if it is permgen, please refer to general OOME (OutOfMemoryError) questions). If you are using Java 1.6 you just need to read the exception message to determine this.

Once you confirm it is a heap shortage, it is advisable to confirm that there is no memory leak occurring before you go for a bigger heap size. To do this, you can attach a heap monitor like visualVM and monitor heap usage under stress (for more information see this: http://olex.openlogic.com/wazi/2009/how-to-fix-memory-leaks-in-java/).

Once you are done with this, and you are sure that you have a legitimate heap shortage, you can edit run.conf (Linux) or run.bat (Windows) to allocate more heap. You can search for JAVA_OPTS and change -Xmx512m to something like -Xmx1024m.

Upvotes: 3

Pål Brattberg
Pål Brattberg

Reputation: 4698

You can increase the memory for JBoss, but make sure to find out why it uses more memory than expected to make sure the problem doesn't come back to bite you.

Set this in your shell before launching JBoss while experimenting:

JAVA_OPTS="-Xms512m -Xmx1024m"

Upvotes: 0

Related Questions