• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Java Virtual Machine for Multiple App

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
If multiple Java applications running on the same machine, then how many JVMs will be invoked? Can anyone tell me? Thanks.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
mike nu
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic