United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6603382 : Plugin2: java.lang.OutOfMemoryError thrown while running some of the applets

Details
Type:
Bug
Submit Date:
2007-09-11
Status:
Closed
Updated Date:
2010-04-04
Project Name:
JDK
Resolved Date:
2007-10-31
Component:
deploy
OS:
windows
Sub-Component:
plugin
CPU:
generic
Priority:
P2
Resolution:
Duplicate
Affected Versions:
7
Fixed Versions:
6u10

Related Reports
Duplicate:

Sub Tasks

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.
                                     
2007-10-31
SUGGESTED FIX

http://analemma.sfbay.sun.com/net/jano2/export2/hotspot/users/kbr/webrevs/mjre/6603382_jvm_parameters/
                                     
2007-09-11
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.
                                     
2007-09-11



Hardware and Software, Engineered to Work Together