JDK-6603382 : Plugin2: java.lang.OutOfMemoryError thrown while running some of the applets
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • CPU: generic
  • Submitted: 2007-09-11
  • Updated: 2010-04-04
  • Resolved: 2007-10-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u10Resolved
Related Reports
Duplicate :  
Description
Scenario I:
With new Plugin out-of-process model , mulitple applets inside the htmls fasils to load by throwing following exception. Exception is getting thrown even -Xmx512m is specified as Runtime Parameters.
Load the following applet inside the browser
http://sqeweb.sfbay.sun.com/deployment2/jitu/deployment_JDK7_int_ws/deployment/src/plugin/manual/html/JvmGifVulPoc.html
If following exception is getting thrown while loading the applets then bug is reproduced:
Exception in thread "AWT-EventQueue-4" java.lang.OutOfMemoryError: Java heap space
    at JvmGifVulPoc.paint(JvmGifVulPoc.java:285)
    at sun.awt.RepaintArea.paintComponent(RepaintArea.java:265)
    at sun.awt.RepaintArea.paint(RepaintArea.java:241)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:315)
    at java.awt.Component.dispatchEventImpl(Component.java:4496)
    at java.awt.Container.dispatchEventImpl(Container.java:2132)
    at java.awt.Component.dispatchEvent(Component.java:4250)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:276)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:191)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:186)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:139)
Plugin2: java.lang.OutOfMemoryError thrown while loading multiple applets with/without -Xmx param

Exception in thread "AWT-EventQueue-2" java.lang.OutOfMemoryError: Java heap space
    at JvmGifVulPoc.paint(JvmGifVulPoc.java:285)
    at sun.awt.RepaintArea.paintComponent(RepaintArea.java:265)
    at sun.awt.RepaintArea.paint(RepaintArea.java:241)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:315)
    at java.awt.Component.dispatchEventImpl(Component.java:4496)
    at java.awt.Container.dispatchEventImpl(Container.java:2132)
    at java.awt.Component.dispatchEvent(Component.java:4250)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:276)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:191)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:186)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:139)
Exception in thread "AWT-EventQueue-3" java.lang.OutOfMemoryError: Java heap space
    at JvmGifVulPoc.paint(JvmGifVulPoc.java:285)
    at sun.awt.RepaintArea.paintComponent(RepaintArea.java:265)
    at sun.awt.RepaintArea.paint(RepaintArea.java:241)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:315)
    at java.awt.Component.dispatchEventImpl(Component.java:4496)
    at java.awt.Container.dispatchEventImpl(Container.java:2132)
    at java.awt.Component.dispatchEvent(Component.java:4250)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:276)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:191)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:186)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)

Scenario II:
Trey loading the following applet inside the browser
http://sqeweb.sfbay.sun.com/deployment2/jitu/deployment_JDK7_int_ws/deployment/src/plugin/manual/html/MemoryTest.html
 If on refreshing the page following exception is getting thrown then bug is reproduced:

Exception in thread "thread applet-MemoryTest.class-6" java.lang.OutOfMemoryError: Java heap space
  at MemoryTest.init(MemoryTest.java:65)
   at sun.plugin2.applet.Applet2Manager$AppletExecutionRunnable.run(Applet2Manager.java:767)
    at java.lang.Thread.run(Thread.java:644)

Note: In this particular test we are defining a byte array, if we set array to null inside the destroy method then no exception is getting thrown.

Comments
EVALUATION This bug is being marked as a duplicate of 6622332 for bookkeeping purposes and does not need to be re-verified independently. In the case of a regression please file a new bug.
31-10-2007

SUGGESTED FIX http://analemma.sfbay.sun.com/net/jano2/export2/hotspot/users/kbr/webrevs/mjre/6603382_jvm_parameters/
11-09-2007

EVALUATION The new plugin has different behavior than the old plugin while starting applets. The old plugin used to initialize applets serially and block the browser while doing so. The new plugin does not block the browser; applets are started asynchronously. Additionally, there is no class loader and AppContext caching in the new plugin (currently), so each of the six applet instances on the web page will be loaded in its own AppContext and receive its own AWT Event Dispatch Thread, meaning that repainting of the applets will occur in parallel whereas before they used to be repainted serially. These differences in behavior basically mean that this particular test case requires roughly six times the RAM it required previously. Attempting to increase the heap size using the Java Control Panel uncovered several bugs in the management of the JVMParameters data structures used to keep track of which attached JVM instance is suitable for running a particular applet. These bugs as well as others have been fixed. The test case will now run correctly if for example -Xmx512m is specified in the Java Applet Runtime Parameters in the Java Control Panel.
11-09-2007