How to resolve OutOfMemoryError: Java heap space error.

Document ID : KB000044142
Last Modified Date : 14/02/2018
Show Technical Document Details

Question:

We have seen below error message in the IM console and server.log. What should we do?

java.lang.OutOfMemoryError: Java heap space

 

Answer:

This message indicates that the Java heap size is not enough for the current usage.

You can change the maximum heap size by increasing the "-Xmx" value in the file.

Please restart your application server for the change to take effect. 

 

Example-1)

JBoss 5.1:

\jboss-5.1.0.GA\bin\run.bat

set JAVA_OPTS=-Djava.security.policy=.\workpoint_client.policy -Xms256m -Xmx1024m -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=50m %JAVA_OPTS%

 

Example-2)

JBoss 6.3:

\jboss\jboss-eap-6.3\bin\standalone.conf.bat

rem # JVM memory allocation pool parameters - modify as appropriate.

 

set "JAVA_OPTS=-Xms1G -Xmx1G -XX:MaxPermSize=256M"