File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Instance of JVM? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Instance of JVM?" Watch "Instance of JVM?" New topic
Author

Instance of JVM?

Soumya Ranjan Mohanty
Ranch Hand

Joined: Mar 07, 2010
Posts: 44
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

Joined: Feb 24, 2006
Posts: 6662
    
    5

Is this a question or a statement ?

Define useless.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Soumya Ranjan Mohanty
Ranch Hand

Joined: Mar 07, 2010
Posts: 44
I am sorry i was not clear. Actually i want to know what is an instance of JVM.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

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

Joined: Jun 28, 2010
Posts: 22
@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


Regards
Himanshu Mall
@mall.himanshu84@gmail.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Instance of JVM?