File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Java Virtual Machine for Multiple App Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Java Virtual Machine for Multiple App" Watch "Java Virtual Machine for Multiple App" New topic
Author

Java Virtual Machine for Multiple App

mike nu
Ranch Hand

Joined: Mar 11, 2001
Posts: 63
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
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.


A Convergent Visionary ~ Frank's Punchbarrel Blog ~ LinkedIn profile
mike nu
Ranch Hand

Joined: Mar 11, 2001
Posts: 63
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
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.
 
 
subject: Java Virtual Machine for Multiple App
 
Threads others viewed
"Fatal exception occurred. Program will exit."
JVMs
multiple jvm for tomcat
Setting environment variables
multiple jvm for tomcat
MyEclipse, The Clear Choice