-
2 Oct 2007 5:02 AM #1
[1.1.1] grid mem leak with iexplorer (urgent...)
[1.1.1] grid mem leak with iexplorer (urgent...)
OS :Windows XP, SP2
Browser : Iexplorer 6.0 (at least, i did not test 7.0)
Mem leak program: Drip
now iCode:// Store definition var ds = new Ext.data.Store({ reader: new Ext.data.ArrayReader({id:0}, [ {name: 'scatag' }, {name: 'pri' } ]) }); // grid definition var colModelAlr = new Ext.grid.ColumnModel([ {id:'scatag' , header: lang['Tag'], width: 60, dataIndex: 'scatag', sortable: true,hidden:true }, {id:'pri' , header: lang['pri'], width: 40, dataIndex: 'pri', sortable: true,hidden:false } ]); grid = new Ext.grid.Grid('alarms-grid', { ds: ds, cm: colModelAlr, selModel: new Ext.grid.RowSelectionModel(), enableColLock:false, loadMask: true, enableDrag: true }); grid.render();Last edited by mystix; 2 Oct 2007 at 7:08 AM. Reason: use [code][/code] tags
-
2 Oct 2007 5:12 AM #2
a strange thing is that if i comment the code
bt.firstChild.removeChild(bt.rows[index]);
on gridview the leak is much less... 1268 nodes...
what the hell ...
Code:the final number of nodes is onRemove : function(ds, record, index, isUpdate){ if(isUpdate !== true){ this.fireEvent("beforerowremoved", this, index, record); } var bt = this.getBodyTable(), lt = this.getLockedTable(); if(bt.rows[index]){ // bt.firstChild.removeChild(bt.rows[index]); } if(lt.rows[index]){ lt.firstChild.removeChild(lt.rows[index]); } if(isUpdate !== true){ this.stripeRows(index); this.syncRowHeights(index, index); this.layout(); this.fireEvent("rowremoved", this, index, record); } },Last edited by mystix; 2 Oct 2007 at 7:08 AM. Reason: use [code][/code] tags
-
2 Oct 2007 5:22 AM #3
here is the dom usage in drip...
it seems that each row is an <tr><td>...
but the
bt.firstChild.removeChild(bt.rows[index]);
does not delete the dom nodes of this tr...
look to drip...
-
2 Oct 2007 6:54 AM #4
I discover the source of the problem...
removeChild in iexplorer does not work... it apeears that it keeps a reference and gc does not collect that object.
this is a probleme since extjs uses a lot removeChild...
check http://www.outofhanwell.com/ieleak/i...e=Fixing_Leaks
this guy show a discard element technique...
Code:function discardElement(element) { var garbageBin = document.getElementById('IELeakGarbageBin'); if (!garbageBin) { garbageBin = document.createElement('DIV'); garbageBin.id = 'IELeakGarbageBin'; garbageBin.style.display = 'none'; document.body.appendChild(garbageBin); } // move the element to the garbage bin garbageBin.appendChild(element); garbageBin.innerHTML = ''; }Last edited by mystix; 2 Oct 2007 at 7:09 AM. Reason: use [code][/code] tags
-
2 Oct 2007 7:18 AM #5
FIX: suggest update to extjs
FIX: suggest update to extjs
suggest to fix leak...
tested in explorer 6.0
from http://www.outofhanwell.com/ieleak/i...e=Fixing_Leaks
The problem is that this should be updated in all removeChild ...Code:Ext.discardElement = function (element) { var garbageBin = document.getElementById('IELeakGarbageBin'); if (!garbageBin) { garbageBin = document.createElement('DIV'); garbageBin.id = 'IELeakGarbageBin'; garbageBin.style.display = 'none'; document.body.appendChild(garbageBin); } // move the element to the garbage bin garbageBin.appendChild(element); garbageBin.innerHTML = ''; } Ext.removeNode = function (node) { if( Ext.isIE ){ Ext.discardElement(node); } else if(node && node.parentNode){ return node.parentNode.removeChild(node); } } Ext.deleteAllChildNodes = function (node) { var count = node.childNodes.length; while(node.hasChildNodes()) { Ext.removeNode(node.firstChild); } return count; } onRemove : function(ds, record, index, isUpdate){ if(isUpdate !== true){ this.fireEvent("beforerowremoved", this, index, record); } var bt = this.getBodyTable(), lt = this.getLockedTable(); //debugger ; if(bt.rows[index]){ Ext.deleteAllChildNodes(bt.rows[index]); //bt.firstChild.removeChild(bt.rows[index]); } if(lt.rows[index]){ Ext.deleteAllChildNodes(lt.rows[index]); //lt.firstChild.removeChild(lt.rows[index]); } if(isUpdate !== true){ this.stripeRows(index); this.syncRowHeights(index, index); this.layout(); this.fireEvent("rowremoved", this, index, record); } },
that a lot in extLast edited by mystix; 2 Oct 2007 at 7:54 AM. Reason: dude, start learning how to use [code][/code] tags!
-
2 Oct 2007 12:20 PM #6
I'm notifying Jack to take a look at this.
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
3 Oct 2007 12:53 AM #7
-
8 Oct 2007 1:32 AM #8
-
30 Oct 2007 10:24 AM #9
No news about this,,,
i think this is really important...
-
31 Oct 2007 8:39 AM #10
A grid leak has already been added to the bug list of Ext 2.0. I cannot say now how and when fixes will be backported to 1.1.1.
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video


Reply With Quote
