If there are several java applications/programs running on the same
machine, are these java applications/programs using their own JVMs or
are they share the same JVM?
Thanks.
|
|
0
|
|
|
|
Reply
|
junw2000 (221)
|
1/25/2010 3:56:59 AM |
|
On 1/24/2010 7:56 PM, Jack wrote:
> If there are several java applications/programs running on the same
> machine, are these java applications/programs using their own JVMs or
> are they share the same JVM?
>
> Thanks.
Each time you start a Java app, you create a new JVM. That's not to say
that you can't have a Java program that loads other Java programs if you
want them run on the same JVM. I don't know what the state of things is
in browsers for sure but I would suspect that every applet that is
loaded gets its own JVM.
--
Knute Johnson
email s/nospam/knute2010/
|
|
0
|
|
|
|
Reply
|
Knute
|
1/25/2010 4:10:01 AM
|
|
Knute Johnson wrote:
> On 1/24/2010 7:56 PM, Jack wrote:
>> If there are several java applications/programs running on the same
>> machine, are these java applications/programs using their own JVMs
>> or
>> are they share the same JVM?
>>
>> Thanks.
>
> Each time you start a Java app, you create a new JVM. That's not to
> say that you can't have a Java program that loads other Java
> programs
> if you want them run on the same JVM. I don't know what the state
> of
> things is in browsers for sure but I would suspect that every applet
> that is loaded gets its own JVM.
Web servers and application servers, in general, run all of their
applications in a single JVM (or perhaps a replicated set of JVMs,
each of which can run any of their applications.)
|
|
0
|
|
|
|
Reply
|
Mike
|
1/25/2010 6:17:03 AM
|
|
According to Jack <junw2000@gmail.com>:
> If there are several java applications/programs running on the same
> machine, are these java applications/programs using their own JVMs or
> are they share the same JVM?
It fully depends on what you mean by "JVM".
At the source code level, two applications or applets are deemed
distinct if they "do not see each other": the classes defined in one
application are not visible from the other, and both applications may
have identically-named classes. Since Java applications are isolated
from system and hardware, that lack of visibility is all that makes
sense from the application point of view.
From the outside, things are more complex. Let's assume for now that the
JVM is launched as the 'java.exe' (Windows) or '/usr/bin/java' (typical
Linux) executable. Then the application runs in its own JVM instance,
i.e. a single process with its address space, separated from the other
processes by way of the operating system facilities. Still, the
executable code comes from files, which are not duplicated (you may run
several applications from the same executable), and the in-memory copy
of executable code may be shared between several concurrently invoked
Java application. This happens under the hood, and is invisible to
applications, except that sharing saves memory and thus improves
performance. On that subject, it is worth noticing that a Java
application involves a rather small chunk of pre-compiled native code,
and a bulk of dynamically translated bytecode; the in-memory sharing of
executable code by the OS can be performed only on the native code.
Another possibility is integrating the JVM in a bigger application, and
calling it through JNI. This involves calling JNI_CreateJavaVM(). There,
several Java VM "instances" may coexist within the same address space.
They still do not see each other, as if they were in separate processes,
but from the OS point of view they are a unique process. The native code
is shared in RAM.
--Thomas Pornin
|
|
0
|
|
|
|
Reply
|
Thomas
|
1/25/2010 1:49:09 PM
|
|
On 25-01-2010 01:17, Mike Schilling wrote:
> Knute Johnson wrote:
>> On 1/24/2010 7:56 PM, Jack wrote:
>>> If there are several java applications/programs running on the same
>>> machine, are these java applications/programs using their own JVMs
>>> or
>>> are they share the same JVM?
>>
>> Each time you start a Java app, you create a new JVM. That's not to
>> say that you can't have a Java program that loads other Java
>> programs
>> if you want them run on the same JVM. I don't know what the state
>> of
>> things is in browsers for sure but I would suspect that every applet
>> that is loaded gets its own JVM.
>
> Web servers and application servers, in general, run all of their
> applications in a single JVM (or perhaps a replicated set of JVMs,
> each of which can run any of their applications.)
Java EE has a different application concept than Java SE.
Seen from Java SE perspective the app server is the app
and the ear's are plugins.
Seen from Java EE perspective the ear's are multiple apps.
Arne
|
|
0
|
|
|
|
Reply
|
ISO
|
1/26/2010 1:05:16 AM
|
|
On Sun, 24 Jan 2010 19:56:59 -0800 (PST), Jack <junw2000@gmail.com>
wrote, quoted or indirectly quoted someone who said :
>If there are several java applications/programs running on the same
>machine, are these java applications/programs using their own JVMs or
>are they share the same JVM?
logically they each have their own JVM, unless you use Echidna.
See http://mindprod.com/jgloss/echidna.html
However most of the JVM on windows is implemented with DLLs which is
shared code. So you have shared code and separate heaps for data.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Don�t be discouraged by a failure. It can be a positive experience. Failure is, in a sense, the highway to success, inasmuch as every discovery of what is false leads us to seek earnestly after what is true, and every fresh experience points out some form of error which we shall afterwards carefully avoid.
~ John Keats (born: 1795-10-31 died: 1821-02-23 at age: 25)
|
|
0
|
|
|
|
Reply
|
Roedy
|
1/26/2010 6:42:38 AM
|
|
On Mon, 25 Jan 2010 22:42:38 -0800, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :
>
>logically they each have their own JVM, unless you use Echidna.
>See http://mindprod.com/jgloss/echidna.html
>
>However most of the JVM on windows is implemented with DLLs which is
>shared code. So you have shared code and separate heaps for data.
Even though they share code, the who JVMs are not aware of the
existence of the other.
OS puts code in read-only, thus shareable memory. It puts data is
separate read-write memory.
The RAM hardware is identical. It is just the memory addressing
hardware is told to block writes to parts of RAM containing code.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Don�t be discouraged by a failure. It can be a positive experience. Failure is, in a sense, the highway to success, inasmuch as every discovery of what is false leads us to seek earnestly after what is true, and every fresh experience points out some form of error which we shall afterwards carefully avoid.
~ John Keats (born: 1795-10-31 died: 1821-02-23 at age: 25)
|
|
0
|
|
|
|
Reply
|
Roedy
|
1/26/2010 10:07:25 AM
|
|
|
6 Replies
300 Views
(page loaded in 0.385 seconds)
Similiar Articles: JVM error (from JDeveloper) - comp.lang.java.help... instance of the Java Virtual Machine ... Application error occurred during request processing - comp.lang ... JVM error (from JDeveloper) - comp.lang.java.help... client\jvm ... Start and Stopping the JVM - comp.lang.java.programmerIIS Stop and Start Application Pool - comp.lang.ruby Start and Stopping the JVM - comp.lang.java.programmer IIS Stop and Start Application Pool - comp.lang.ruby Start and ... Unable to run a java aplication as service or scheduled task ...... task, but it doen't work, because I can't run the>> JVM.Just speculating, if the application ... Running Java Applications as a Windows Service Running Java Applications ... 32 bit applet on 64 bit Java? - comp.lang.java.programmer ...You can compile the Java using a 32bit or a > 64bit JDK and run the generated byte-code on any compliant JVM, 32bit or > 64bit. > >> >> 3. Are java applications even ... How does one find the terminal's width within the JVM? - comp.lang ...If you know a target platform of your application, or more ... Wikipedia, the free encyclopedia A Java virtual machine (JVM) is a virtual machine that can execute Java ... Hox to match Linux PID to tomcat thread - comp.lang.java ...Fromtime to time, our users tell us, that our web application ... PID to a Tomcat Thread?I have also tried to do a Java ... may want to play with the memory settingsof the JVM ... Application error occurred during request processing - comp.lang ...how call Windows Service from java application ? - comp.lang.java ... Application error ... JVM error (from JDeveloper) - comp.lang.java.help... client\jvm.dll and in web ... JTable and input methods (or, and: focus in JTextField) - comp ...... practice their Chinese vocabulary. Part of the application is ... the most basic JTable example, taken from the Sun Java ... You mean has an exception or the JVM crashes? If the ... message application error 0xc150002 help plz - comp.soft-sys ...... there is a window appearing with a message says: the application was ... Tomcat 32 bits vs Tomcat 64 bits - comp.lang.java.programmer ... message application error 0xc150002 ... Identifier Expected Error in JSP page - comp.lang.java.programmer ...Identifier Expected Error in JSP page ... CIEB Engineering: Web Applications with Java/JSP ... JVM error (from JDeveloper) - comp.lang.java.help Identifier Expected Error ... Download Free Java SoftwareThis page is your source to download or update your existing Java Runtime Environment, also known as the Java Virtual Machine (JVM, VM, and Java VM), the Java Runtime ... java.com: Java + YouGet the latest Java Software and explore how Java technology provides a better digital experience. 7/24/2012 7:40:34 AM
|