Tomcat and VM

java, servlets, tomcat

Solution

Tomcat will run within the JVM, and servlets execute within the Tomcat process (in the same JVM).

Running catalina.sh (or .bat) will start up a new JVM for Tomcat to run in. You can load/run Tomcat programatically within an existing JVM if you require a webserver as part of a bigger application.

Problem

I really confused in understanding where the tomcat actually runs. Is it execute inside the JVM, which execute servlets. Or it has it's own VM in executing servlet or JSP. Thanks in advance.

Original source