Hi there, If multiple Java applications running on the same machine, then how many JVMs will be invoked? Can anyone tell me? Thanks.
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
0
Might be one, might be many. I realize that's not a very helpful answer, but it depends on the applications, and how they were loaded and started. A typical servlet container (a.k.a "application server") runs lots of separate applications in a single JVM. Some of the JINI code examples use as many as six JVMs for a single application! And there are examples of all the points in between. If you start your applications by typing "java Whatever" or clicking on an icon which does the same, then they usually run in one JVM each.
Hi Sheriff, Thanks a lot for your replies. So if I invoke multiple Apps, like 5, using "java app", then there should be at least 5 JVMs. Right? Mike
Robert Paris
Ranch Hand
Joined: Jul 28, 2002
Posts: 585
posted
0
probably, but not necessarily. Say for example that two of the apps work together and the first one listens on a port. When the second starts up there's another JVM for it, BUT it contacts the first via the port, lets it know it wants to be started inside that VM instance, maybe sends some data and closes itself. Now you've got two apps in one JVM. Usually, this is not the case though.