Communication Between Applets Fail As a JVM Becomes "Tainted" or Runs Out of Resources
(Doc ID 1479834.1)
Last updated on NOVEMBER 05, 2016
Applies to:Java Platform, Standard Edition - Version 1.6.0 to 7 [Release 1.6 to 7]
Information in this document applies to any platform.
If a website contains multiple applets, it is often the case that they communicate with each other. Many developers use AppletContext.getApplets(). This provides an Enumeration of all the applets running on the same page as the calling applet. This works as long as all applets run in the same JVM. Starting with the next-gen plugin, this is no longer always the case.
Starting with the next-generation plugin, which was introduced in Java 6 update 10, an applet no longer runs in the browser space. Instead it runs in one or more separate JVM processes.
As long as the resources of an existing JVM process are not exhausted, a new applet will be admitted to that already running JVM. However should the heap of the existing JVM be too small to admit a new applet, a new JVM process is spawned. That new applet, which is now running in a separate JVM, cannot be seen by AppletContext.getApplets(). This in turn will break the inter-applet communication algorithm of legacy applications.
Unfortunately there is another reason why a separate JVM may need to be spawned rather than reusing an existing JVM. This is despite that existing JVM having enough resources to host a new applet. This is because an applet can become "tainted". You can observe this when tracing a running applet:
The above results in the creation of an additional JVM process.
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!