View Full Version : [OPEN-1099] Tiny memory increase in Ext.lib.Ajax, so tiny...

2 Jul 2010, 1:59 AM
Ext version tested:

Ext 3.1.0

Adapter used:


css used:

only default ext-all.css

Browser versions tested against:

sIEve (IE7)

Operating System:

WinXP Pro


Every ajax request will make about 0.13K memory increase in my sIEve.
Because Ext.lib.Ajax.poll & timeout object will add one property for every request.
After request complete, the property will set to null, not delete.
(delete is not enough with IE, because IE Object leaks)
This also cost some memory, though it's so tiny.
But if one request per second, and keep whole day, it will be 86400 * 2 property, about 10M

Test Case:

}, 10);
Possible fix:

// because "IE Object leaks", haven't directly use "delete"
function clean(obj) {
var o = {}, n,
for (n in obj) {
if (obj.hasOwnProperty(n)) {
v = obj[n];
if (v !== null) {
o[n] = v;
return o;
Ext.deepCleanThreadId = setInterval(function(){
Ext.lib.Ajax.poll = clean(Ext.lib.Ajax.poll);
Ext.lib.Ajax.timeout = clean(Ext.lib.Ajax.timeout);
}, 30000);

2 Jul 2010, 12:23 PM
Nice catch!

6 Jul 2010, 2:05 PM
Very nice. Small suggestion for readers: append "v;" to the variable declaration line.

var o = {}, n, v;