开发者

Jboss memory problem

开发者 https://www.devze.com 2023-03-06 02:58 出处:网络
I am facing \"Out Of Memory Er开发者_如何学编程ror Exception\" while running a web service application over jboss 4.2

I am facing "Out Of Memory Er开发者_如何学编程ror 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 ?


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.


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"
0

精彩评论

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