IE memory leak related to timeout setting

Description

----Original Message---- From: Christofer Jennings
Sent: den 8 juli 2007 01:08
To: users@dwr.dev.java.net
Subject: [dwr-user] IE memory leak related to timeout setting?

There might be an IE memory leak in engine.js related to timeout settings.

I've been chasing a memory leak for quite a while. After many tests, I
think I've isolated it to setting a timeout for a DWR call. Below is
the lines in dwr version 2.0.1's engine.js that I think look
suspicious because of the function block / closure (lines 634 - 635).
Below that is my jsp with a comment on the timeout line. The poll
method returns a response object with a message property, but
otherwise it's pretty straight forward. Attached is the Process
Explorer memory use graph showing slopes for when the timeout is set,
as well as no slope when timeout is not set.

My tests were all done using IE 7 (version 7.0.5730.11) on Windows XP,
but I've seen the (possibly) same leak in IE 6. I think they are the
same as far as this is concerned.

In any case, my next test will be to change the closure to a function reference.

Does this look right? Has anyone else had trouble with timeout
settings and IE memory leaks?

,chris

  1.  

    1.  

      1.  

        1. from engine.js ######
          if (batch.timeout && batch.timeout != 0) {
          batch.interval = setInterval(function() {
          dwr.engine._abortRequest(batch); }, batch.timeout);
          }

  1.  

    1.  

      1.  

        1. my jsp ############
          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
          "http://www.w3.org/TR/html4/loose.dtd">
          <html>
          <head>
          <title>DWR Poll Test</title>
          <script type='text/javascript' src='../dwr/interface/MyObject.js'></script>
          <script type="text/javascript">
          function doPoll()
          {
          MyObject.poll(
          {
          timeout: 2000, /* removing this line stops the leak */
          callback:function(response)
          {
          var now = new Date();
          var msg = now + "\n----------------------";
          msg += "\n message = " + response.message;
          msg += "\n----------------------\n" + now;
          dojo.byId("theTextArea").value = msg;
          }
          });
          }

window.setInterval(doPoll, 1000);
</script>
</head>

<body>
<h2>DWR Poll Test</h2>
<textarea id="theTextArea" rows="10" cols="60"></textarea>
</body>
</html>

Activity

Show:
Mike Wilson
April 8, 2008, 12:50 PM

Fixed issue by changing interval to timeout.

Jose Lumang
May 7, 2008, 6:49 PM

Hi Mike,

Where can we get the 2.0.4 version? We are also having similar issue wit our app using IE that after a while the whole app freezes.

Jay

Mike Wilson
May 8, 2008, 8:19 AM
Jose Lumang
May 8, 2008, 8:46 PM

Mike,

After upgrading to 2.0.4 the hanging stops.

By default is DWR setup in Passive mode.

Is there a recommended configuration?

Sorry to ask so many question i'm kinda new to DWR.

Thanks.

Jay

Mike Wilson
May 8, 2008, 8:59 PM

For questions on how to use DWR please use the mailing list, see http://getahead.org/dwr/support.

Assignee

Mike Wilson

Reporter

Mike Wilson

Labels

None

Documentation Required

None

Components

Fix versions

Affects versions

Priority

Major
Configure