JSObject leaks on MSJVM

P

Pratul Chatterjee

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
 
A

Andrew Thompson

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.
 
P

Pratul Chatterjee

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top