File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Do multiple applets require multiple JVMs/JREs! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Do multiple applets require multiple JVMs/JREs!" Watch "Do multiple applets require multiple JVMs/JREs!" New topic
Author

Do multiple applets require multiple JVMs/JREs!

Robin Sharma
Ranch Hand

Joined: Aug 24, 2005
Posts: 76
Hi Guys!

Suppose I have 4 browser windows open and in each window I load an applet. Does it mean that there are 4 different JVMs/JREs running or is it that the same runtime can cater to all the different applets.

Thanks.


DW
There is always a bug :-)
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Generally it will be just one JVM with carefully-arranged ClassLoaders to keep the applets from knowing about one another.


[Jess in Action][AskingGoodQuestions]
Robin Sharma
Ranch Hand

Joined: Aug 24, 2005
Posts: 76
Originally posted by Ernest Friedman-Hill:
Generally it will be just one JVM with carefully-arranged ClassLoaders to keep the applets from knowing about one another.


Hey Ernest!

If that is the case, then why do multiple Java icons appear in the system tray (Windows) as multiple applets are opened? Do they represent multiple JREs getting launched, or do they just indicate a new applet thread getting started? Another interesting thing I noticed was that if i initially opened a browser window and then opened the rest of them by doing a Ctrl+N, thus launching multiple applets, the icons did not increase in number.

Help me out here, please.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

First, note that I'm talking about the Sun Java Plug-in; if you've got some other way to run applets, then all of this doesn't necessarily apply.

You shouldn't see any Java icons in the system tray, unless your applets are opening windows of their own; in that case, then those windows will have icons like any other windows.

Open up the "Sun Java Console" and press "l" which should list the applet classloaders in use; you should see one classloader for each applet. Hopefully this is enough proof that they're all in the same process.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Do multiple applets require multiple JVMs/JREs!