JDK-4848004 : Java Plug-in for IE creates handles for each jsto java call and never release th
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.3.1,1.4.1,1.4.2
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-04-14
  • Updated: 2003-08-06
  • Resolved: 2003-05-02
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.
Other
1.4.2 b22Fixed
Related Reports
Duplicate :  
Description
Name: gm110360			Date: 04/14/2003


FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
This is a very severe bug affecting following plugins

1.4.1
1.4.1_01
1.4.1_02
1.4.2 beta

For every call to a java method from javascript a handle is created and never released. This eventually brings down the machine by exahusting memory, bringing the machine on its knees. Entire application starts to malfunction on javascript side. If the java method call is done inside a javascript eventhandler, the calls line up into the stack and blowing the browser into dust. This is a very severe bug, and I am surprised to see a basic handle management was taken bugged down on new plugins. We expect to see improvement on Sun's java plugins, not suffering. If 1.4.2 goes out with every XP machine out there, it is going to be a catastrophy for the companies which have products depending on liveconnect. 1.4.2 is still beta, you still have opportunity to correct this.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Open window task manager and observe the number of handles and memory while running the following test case
---------------------------------------------------------------------------
** The following html is used: (test1.htm)
---------------------------------------------------------------------------
<html>
<head>
<script LANGUAGE="JavaScript">
function blowHandles() {
for (var i=0;i<10000;i++) { a1.method1 (); }
window.setInterval(blowMoreHandles,5);
}
function blowMoreHandles() {
  a1.method1 ();
}
</script>
</head>
<body>
<input type=button onclick="blowHandles()" value="Test"></input>
<APPLET code="test1.applet1.class" archive="test1.jar" id="a1" name="a1">
<PARAM NAME = "scriptable"VALUE="true">';
</APPLET>
</body>
</html>
---------------------------------------------------------------------------

---------------------------------------------------------------------------
** The following applet: (test1/applet1.java)
---------------------------------------------------------------------------
package test1;
import java.applet.*;
public class applet1 extends Applet {
public void method1 () {}
}


EXPECTED VERSUS ACTUAL BEHAVIOR :
Handles should not increase, and MUST be release after each java metho call from javascript.
Handles are created and never released until the computer goes out of resources.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
---------------------------------------------------------------------------
** The following html is used: (test1.htm)
---------------------------------------------------------------------------
<html>
<head>
<script LANGUAGE="JavaScript">
function blowHandles() {
for (var i=0;i<10000;i++) { a1.method1 (); }
window.setInterval(blowMoreHandles,5);
}
function blowMoreHandles() {
  a1.method1 ();
}
</script>
</head>
<body>
<input type=button onclick="blowHandles()" value="Test"></input>
<APPLET code="test1.applet1.class" archive="test1.jar" id="a1" name="a1">
<PARAM NAME = "scriptable"VALUE="true">';
</APPLET>
</body>
</html>
---------------------------------------------------------------------------

---------------------------------------------------------------------------
** The following applet: (test1/applet1.java)
---------------------------------------------------------------------------
package test1;
import java.applet.*;
public class applet1 extends Applet {
public void method1 () {}
}

---------- END SOURCE ----------
(Review ID: 183999) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis-rc tiger FIXED IN: mantis-rc tiger INTEGRATED IN: mantis-b22 mantis-rc tiger tiger-b14
14-06-2004

EVALUATION Reassign to Deva. ###@###.### 2003-04-14 The handle to a new thread which is forked for every JavaScript->Java call is not closed ###@###.### 2003-04-14 We should try to fix this in Mantis before FCS. ###@###.### 2003-04-19 Reassign to Zhengyu. ###@###.### 2003-04-20 Leak thread handle. ###@###.### 2003-04-24
19-04-2003