Friday, September 5, 2014

Enlarge memory for tomcat in Ubuntu

To solve OutOfMemoryException, you could edit this file:
/etc/init.d/tomcat7

Found lines with definition of variable JAVA_OPTS and correct memory limits on what you want. For example I have set 700 mb, and it looks this way: 
if [ -z "$JAVA_OPTS" ]; then
        JAVA_OPTS="-Djava.awt.headless=true -Xms700m -Xmx700m"
fi


At the end, to make the change on real, restart server with this command:
sudo service tomcat7 restart

No comments:

Post a Comment