Pages

Monday, May 5, 2014

How to update heap size in tomcat 7

Step 1: Open up the catalina.sh file with any text editor.

Step 2: Search for "JAVA_OPTS=" in the file and in particular locate the following lines of code:


if [ -z "$LOGGING_MANAGER" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
else 
JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER"
fi


Step 3: At the end of the JAVA_OPTS definitions add "-Xms256m -Xmx512m".


if [ -z "$LOGGING_MANAGER" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms256m -Xmx512m"
else 
JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -Xms256m -Xmx512m"
fi


Step 4: Save the file and restart Tomcat.

No comments: