• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Instance of JVM?

 
Soumya Ranjan Mohanty
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The value of a Java reference has meaning only within the context of a single instance of a JVM. In other words, if you tried to restore the object in another instance of the JVM, even running on the same computer on which the object was originally serialized, the reference would be useless.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a question or a statement ?

Define useless.
 
Soumya Ranjan Mohanty
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry i was not clear. Actually i want to know what is an instance of JVM.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you run 2 java processes, you have 2 JVM instances running on the system with a separate heap allocated to each one.

Of course I am trying to boil down the concept and present to you a single line which would be simple to understand. If your question has a more specific direction, I can follow it up with an answer that is more narrow.
 
Himanshu Mall
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Soumya

Please bear in mind that whenever you talk about JVM, you may be actually talking about three different things:

1) The abstract Specification.

2) A concrete implementation (of spec)

3) A run-time instance of a Java Virtual Machine.

The aim or mission of a run-time instance of JVM is : to run one Java Application.

When a Java application starts, a run-rime instance of JVM is born and when application completes/terminates, the instance dies.
Each Java application runs inside its own run-time instance of JVM.
i.e. If you start three Java Application on the same computer, using the same concrete implementation of JVM, three seperate run-time instance will born, for each application.

@For the curious: A run-time instance of Java Virtual Machine continues to live as long as any non-daemon threads are running. When all non-daemon threads of application terminates, the run-time instance of JVM will die.


Note: This excerpt is from a MUST READ book - Inside the Java Virtual Machine by Bill Venners. One can also check out : Java Corner-Artima


Hope it helps.

Himanshu Mall
@mall.himanshu84@gmail.com

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic