JVM reaction to multiple programs?

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

JVM reaction to multiple programs?

 
0
  #1
Sep 12th, 2005
Let's say I have 5 applets on the same page. How does the JVM respond to that? Will a new implementation be created for each applet, or does each applet share the jvm? Also, is there some priority, like the first applet added will be the first loaded?

Hope that made sense.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: JVM reaction to multiple programs?

 
0
  #2
Sep 12th, 2005
For applets a single VM will typically run all of them for a single INSTANCE of the browser executable (though one could theoretically create a browser that instantiates a new JVM for each applet instance such is AFAIK never done in practice).

The applets will exist in the JVM as separate instances of the same class within a single application space, therefore any static data will be shared between all instances.
This holds true if you have multiple browser windows open, as long as these were created to exist within a single instance of the browser executable.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: JVM reaction to multiple programs?

 
0
  #3
Sep 12th, 2005
So, is there anything you can do to escape a performance loss?...Like slow loading.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: JVM reaction to multiple programs?

 
0
  #4
Sep 12th, 2005
You should get superior performance as the JVM and classes are loaded only once instead of being loaded for each applet instance separately.

Of course if your applet uses a LOT of instance specific resources you can get into problems with the available memory to the JVM but that's usually a sign of poor design of the applet more than anything else.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: JVM reaction to multiple programs?

 
0
  #5
Sep 12th, 2005
Thanks, I guess I'm just confusing myself again.
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 609
Reputation: freesoft_2000 is an unknown quantity at this point 
Solved Threads: 8
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: JVM reaction to multiple programs?

 
0
  #6
Sep 20th, 2005
Hi everyone,

This is an interesting topic.

jwenting if a single vm runs all the applets on a single html page then what about apllications? Does it also use the same jvm to run another application or is another instance of that program created

Richard West
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 216
Reputation: hooknc is an unknown quantity at this point 
Solved Threads: 8
hooknc hooknc is offline Offline
Posting Whiz in Training

Re: JVM reaction to multiple programs?

 
0
  #7
Sep 20th, 2005
Originally Posted by freesoft_2000
Hi everyone,

This is an interesting topic.

jwenting if a single vm runs all the applets on a single html page then what about apllications? Does it also use the same jvm to run another application or is another instance of that program created

Richard West
No, each application gets its own instance of the JVM.

There are ways of getting the applications to talk to one another, but that is a different topic.

Regards,

Nate
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: JVM reaction to multiple programs?

 
0
  #8
Sep 20th, 2005
You could of course create a launcher which starts several applications inside a single JVM, but they'd for the JVM all be the same application which would likely play hell on things like Swing user interfaces.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC