Select Page

1:My Server Memory is 4 GB, we will set Heap Memory accordiangly.
2:Login Server via SSH and to see runng Heap Memory, run below command
# Ps -ef | grep tomcat (you will see below output)
tomcat7 21206 1 8 Apr12 ? 02:18:04 /usr/lib/jvm/java-8-oracle/bin/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx512m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp org.apache.catalina.startup.Bootstrap start

3:now open below files and make change as per given lines:
# vim /etc/default/tomcat7 (and find below lines and make change as per momeory availability:

JAVA_OPTS=”-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xms3072m -Xmx3072m -XX:MaxPermSize=1536m -XX:+UseConcMarkSweepGC”

4:Restart Tomcat (#/etc/init.d/tomcat7 restart)
5:Run below command to see updated memory setup:
#ps -aux | grep tomcat
tomcat7 1331 1 3 22:41 ? 00:00:45 /usr/lib/jvm/java-8-oracle/bin/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xms3072m -Xmx3072m -XX:MaxPermSize=1536m -XX:+UseConcMarkSweepGC -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp org.apache.catalina.startup.Bootstrap start