JSObject leaks on MSJVM  
Author Message
p.chatterjee





PostPosted: 2004-6-14 18:38:00 Top

java-programmer, JSObject leaks on MSJVM Microsoft have agreed to support the MSJVM until the end of 2007.
Some of our clients may still have the MSJVM on their machines and
their corporate software upgrade policies may not allow them to
replace the MSJVM with the latest one from Sun immediately. This has
created a difficult situation for me. I have one applet which runs
fine on Windows NT/2000/XP/2003 with IE 6/Sun JVM (1.4.2_04) and does
not leak memory. It works fine on Windows NT with IE 5.5/MSJVM 3810.
However, it leaks on Windows 2000/XP/2003 with IE 6/ MSJVM 3810! The
applet calls JSObject.call() and that's where it leaks. I have
replaced the calls with JSObject.eval() but did not improve the
situation. The rate of leak was slow.

I have another similar applet with a different threading model which
does not leak on MSJVM 3810. So I cannot say that JSObject is leaking
on IE 6 regardless.

I know people had similar problems with the Sun JVM 1.3.1 where every
call to JSObject was leaking around 40 bytes. I did not see anyone
complaining about MSJVM though.

Any ideas?

Many thanks in advance.

Pratul
 
Andrew Thompson





PostPosted: 2004-6-14 19:17:00 Top

java-programmer >> JSObject leaks on MSJVM On 14 Jun 2004 03:37:41 -0700, Pratul Chatterjee wrote:

> It works fine on Windows NT with IE 5.5/MSJVM 3810.
> However, it leaks on Windows 2000/XP/2003 with IE 6/ MSJVM 3810! The
> applet calls JSObject.call() and that's where it leaks. I have
> replaced the calls with JSObject.eval() but did not improve the
> situation.

Can you make a test case with SSCCE for us?
<http://www.physci.org/codes/sscce.jsp>
Link to the code form the applet URL.

..& yes, I have a 3810 installed, so I
can check it.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
p.chatterjee





PostPosted: 2004-6-15 19:19:00 Top

java-programmer >> JSObject leaks on MSJVM Many thanks for your reply. I am not sure whether I could expose a
test page through our firewall. It involves permissions and other
problems.

Tell me if you are aware of any thread related issues in calling
methods on netscape.javascript.JSObject. The applet in question
creates internal threads and they call a synchronized method in the
main applet class (i.e. the one derived from java.applet.Applet). The
main applet class creates a reference to the browser window in the
init() method:

/* data member */ browserWindow = JSObject.getWindow(this);

The synchronized method to call JavaScript functions does the
following:

browserWindow.call(methodName, methodArguments);

I even tried this to release the reference every time:
JSObject browserWindow = JSObject.getWindow(this);
browserWindow.call(methodName, methodArguments);
browserWindow = null;

No joy with the memory leak!


Pratul