Memory Leak When Using jQuery UI Tabs (ver 1.8.9)
I'm getting a memory leak when using the jQuery 1.8.9 UI tabs, and am a little baffled as to what might be causing it. The issue only seems to present in IE. I'm using IE8, (haven't tested in on 7 or 6). Firefox and Chrome are ok.
The tabs are initialised like so:
$("#tabContent").tabs({ cache: false, ajaxOptions: { cache: false} });
$("#tabContent").bind('tabsselect', tabSelected);
$("#tabContent").bind('tabsload', tabLoaded);
$("#tabContent").tabs("url", 0, "SomePage.aspx?id=1" + "&project=" + projectName);
$("#tabContent").tabs("url", 1, "SomePage.aspx?id=2" + "&project=" + projectName);
$("#tabContent").tabs("url", 2, "SomePage.aspx?id=3" + "&project=" + projectName);
$("#tabContent").tabs("url", 3, "SomePage.aspx?id=4" + "&project=" + projectName);
The page 'SomePage' has a list with a status column, which I need to check for update. I'm polling this e开发者_如何转开发very 5000 milliseconds (using this timeout plugin):
$.doTimeout('tabDisplay', 5000, function() {
$("#tabContent").tabs("load", $("#tabContent").tabs('option', 'selected'));
return true;
});
And sure, enough every 5 seconds the memory usage climbs (in direct proportion to the size of the list on that tab).
Any suggestions as to what might be causing this?
I can't really help with this but I can tell you I've struggled quite a lot for the same issues The other day someone else had another problem with IE8 and jQuery . I don't think it is related to jQuery UI but I reckon has more to do with jQuery and IE8:
http://spin.atomicobject.com/2010/10/08/jquery-ajax-memory-leak-in-ie8#fn0
http://bugs.jquery.com/ticket/6242
I had founds loads of people struggling for the same problems but no real solution.
PS: in all these situation there's a polling. It seems that jQuery doesn't dispose the resources. I am referring to jQuery 1.4.x
精彩评论