1
Vote

Memory leak in IE7

description

There is a memory leak that I have discovered in IE7. It is more obvious if requests to a webservice are being performed frequently (I make them at 3 sec intervals).

file attachments

comments

costinbobes wrote Jun 10, 2008 at 6:16 PM

There is a memory leak that I have discovered in IE7. It is more obvious if requests to a webservice are being performed frequently (I make them at 3 sec intervals). The issue is not present in Firefox. In IE7/XP it is only present for async calls, sync calls don't seem to be causing the issue.

costinbobes wrote Jun 10, 2008 at 6:32 PM

Process with async calls

wrote Jun 10, 2008 at 6:32 PM

costinbobes wrote Jun 10, 2008 at 6:35 PM

When using async calls the memory usage keeps going up - as shown in the graph, while when using sync calls the memory usage is constant

wrote Jun 10, 2008 at 6:35 PM

mhassman wrote Apr 22, 2009 at 8:23 PM

I experienced this same memory leak for async calls in IE7.
Appears to be fixed with the following:

Changed this:
        if(xmlHttp.readyState == 4)
            SOAPClient._onSendSoapRequest(method, async, callback, wsdl, xmlHttp);
To this:
        if(xmlHttp.readyState == 4)
            {
            xmlHttp.onreadystatechange = null;
            SOAPClient._onSendSoapRequest(method, async, callback, wsdl, xmlHttp);
            }
Note: I have only tested this within IE7.. no idea if it will break other browsers.

Credit goes to this article for pointing me the right direction:
http://bytes.com/groups/javascript/152714-closures-xmlhttprequest-memory-leak

wrote Feb 21, 2013 at 10:43 PM