Forum Stats

  • 3,828,088 Users
  • 2,260,862 Discussions


Applet calling javascript function causing memory leak


I'm troubleshooting one memory leak issue in my application and to do that I created one simple Java applet and HTML + javascript function to locate the problem.
Basically it's an applet calling a javascript function using a timer. The javascript function simply does nothing.
I tested in IE 8.0 and JRE 1.6.0_23-b05 and memory of IE keeps increasing.
I saw this bug which seems related with my issue, but if I understand correctly from the page, the issue should have been fixed.

I posted this message to find out if others also find same issue and if there's a solution for this. If I comment out"dummy", null); , memory will not climb up.

Java code
+public class Main extends Applet implements Runnable {+

public Applet currentApplet= this ;
+ public JSObject window = null;+

+public void run(){+
+ System.out.println("run..");+
+ }+

+public void start(){+

window = JSObject.getWindow(this);

int delay = 300; //milliseconds
+ActionListener taskPerformer = new ActionListener() {+
+public void actionPerformed(ActionEvent evt) {+"dummy", null);
new Timer(delay, taskPerformer).start();
+ }+

+public static void main(String[] args) {+

+ System.out.println("start...");+

+ Main main = new Main();+
+ main.start();+
+ }+

Javascript source code
+function dummy() {+
+ +
+<applet .... >+
This discussion has been closed.