Reputation: 5474
I'm having hard time googling this so I hope somebody would give me some light. If my question is off please put me in the right direction.
I have two web applications. They are hosted in one Tomcat server instance. Each can be accessed using the same port.
How is the JVM of the server look like? Will the server contain two different instance of JVM, one per each web application. Thank you in advance.
Upvotes: 1
Views: 1559
Reputation: 126
The AppServer runs on one JVM. It is optimized to run multiple applications and this is done in a threaded way. Please note that I am not considering clustering in this answer.
The AppServer takes a request, it checks it's farm to see if the Web application is present and if it does exist, checks it's web.xml to check if a path to a requested servlet exists. If all goes fine, the AppServer spawns a new thread (or uses an existing one from the thread pool which is configurable at the AppServer level) and assigns the thread to handle the servlet thus catering to the user.
Upvotes: 2
Reputation: 7501
If they're hosted on one Tomcat instance then they'll be running on the same JVM.
Upvotes: 1