• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple Processes

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to do some searching on a query from a friend of mine. If suppose I run multiple instances of a java program (same or different) will there be single or multiple instances of JVM running, assuming all these setup being on the same macine.

I feel that there will be multiple instances of JVM as we specify JVM congigs seperately during program launch.
 
Pradeep Kadambar
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it were to be running on the same JVM .... can we achieve better memory management for the machine.

This may ease the GC process too...
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A JVM will be initialized whenever someone (script/command line/process) calls the following executable:
<jdk_root>/bin/java
with a valid fully qualified class name.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, any time you start java.exe (or whatever on *nix) you get a new JVM. This is both good and bad. They are isolated from one another, so if one gets into memory trouble or completely crashes the others keep running. But it takes significant time and memory to start a JVM so it might be nice to run multiple "applications" in one JVM. There are some schemes to do the latter, but the challenges of keeping them properly isolated are many. They might want to run different versions of the same jar or put class paths in different orders or any number of oddball things.

Do you have a particular problem situation in mind? A server that seems to be running a lot of JVMs?
reply
    Bookmark Topic Watch Topic
  • New Topic