If you get an error 'java.lang.Out Of Memory Error: PermGen space' in your Jboss application, may be memory space not enough for running your application,
The below error shows on the browser,
HTTP Status 500 -
java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space
Also check in Jboss log using tail command
tail -f /usr/local/jboss-4.2.3.GA/server/default/log/server.log
Caused by: java.lang.OutOfMemoryError: PermGen space
2014-07-02 18:54:09,154 WARN [org.jboss.seam.web.ExceptionFilter] exception root cause
2014-07-02 18:54:09,154 WARN [org.jboss.seam.web.ExceptionFilter] running exception handlers
Before increasing MaxPermSize parameter for jboss application need to check that existing allocated space using ps aux command,
ps aux | grep java
root 15274 20.5 20.7 1714596 424100 ? Sl 17:26 26:51 /usr/java/jdk1.7.0_21//bin/java -Dprogram.name=run.sh -server -Xms128m -Xmx800m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/usr/local/jboss-4.2.3.GA/lib/endorsed -classpath /usr/local/jboss-4.2.3.GA/bin/run.jar:/usr/java/jdk1.7.0_21//lib/tools.jar org.jboss.Main
Add MaxPerSize :
Open your jboss bin direcotry /jboss-path/bin
# cd /usr/local/jboss-4.2.3.GA/bin
Before the update your memory space limit takes a backup copy at any file name
# cp run.conf run.conf_bak
# vi /usr/local/jboss-4.2.3.GA/bin/run.conf
# vi /usr/local/jboss-4.2.3.GA/bin/run.conf
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms128m -Xmx800m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
fi
Change to
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms128m -Xmx1024m -XX:MaxPermSize=512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
fi
Once make the changes need to restart Jboss
# pgrep -f java
1254
# kill -9 1254
# /usr/local/jboss-4.2.3.GA/bin/run.sh
1254
# kill -9 1254
# /usr/local/jboss-4.2.3.GA/bin/run.sh
Comments (0)