Reputation: 449
I Have set the heap size of tomcat 7 by adding boot script:
export CATALINA_OPTS="-Xms1024m -Xmx248m"
I change /etc/init.d/tomcat7 :
if [ -z "$JAVA_OPTS" ]; then
JAVA_OPTS="-Djava.awt.headless=true -Xmx2048M -Xms1024M"
fi
I Reboot the computer and restart the Tomcat:
service tomcat7 restart
And verify the $CATALINA_OPTS Works:
> echo $CATALINA_OPTS
-Xms1024m -Xmx2048m
But when I go to the tomcat manager, I note that the heap has not changed.
Free memory: 38.02 MB Total memory: 123.75 MB Max memory: 123.75 MB
Please, i need help about this.
Upvotes: 0
Views: 877
Reputation: 481
Check the setenv.sh
in tomcat/bin
, according to manual this should be the right place to put those params.
Another option, it depend on your OS tomcat package, may be that config param are overrided in /etc/conf.d/tomcat/
or /etc/tomcat
. Just check your init script and your catalina.sh to find where your settings are overrided.
Btw if you run a ps -ef | grep tomcat
you should see the full command line with arguments: this may give you an idea of how init script build the command, and so you can investigate where params are set.
Upvotes: 1
Reputation: 2702
Have you tried creating a setenv.sh script in the $CATALINA_HOME/bin directory with your options in it?
I find that setting JAVA_OPTS="-Xmx2048m -Xms1024m" in there works pretty well.
Upvotes: 0