How and where do I change the option for JVM heap memory in Tomcat?

Alessandro A. Garbagnati

If you look into the tomcat.sh or tomcat.bat under the bin directory of tomcat, you can see an environment variable called TOMCAT_OPTS.

You can use it for passing all the JVM specific parameters, like the -X or -D.

You can set it directly in the file, or set it in the environment before calling it. For example in unix you can do:
export TOMCAT_OPTS=" -Xms15M -Xmx15M"
tomcat.sh start

For Tomcat 4.x.x, the logic is the same, but the filenames and the variable name are different.
The environment variable is CATALINA_OPTS, and you can find references in catalina.sh or catalina.bat.