How can I control IE6+jQuery+jQuery-ui memory leaks?

Here's a [sample page][1] with a couple datepickers. Here's the Drip result for that: ![alt text][2] This page leaks indefinitely in IE6sp1 when I click the Refresh button repeatedly (IE6sp3+, Opera 9, Chrome2, and FF3+ seem to be good). The memory goes up and never goes down until I actually close the browser completely. I've also tried using the latest nightly of jquery (r6414) and the latest stable UI (1.7.2) but it didn't make any difference. I've tried various things with no success ([CollectGarbage][3], [AntiLeak][4], others). I'm looking for a solution other than "use a different browser!!1" as I don't have any control over that. Any help will be greatly appreciated! **Update 1:** I added that button event to a loop and this is what happens (the sudden drop off is when I terminate IE): ![alt text][5] **Update 2:** I filed a [bug report][6] (fingers crossed). **Update 3:** This is also on the [mailing list][7]. **Update 4:** This (as reported on the mailing list) doesn't work, and in fact makes things worse: $(window).bind("unload", function() { $('.hasDatepicker').datepicker('destroy'); $(window).unbind(); }); It's not enough to just call destroy. I'm still stranded with this one and getting very close to ripping jquery out of the project. I love it (I really do!) but if it's broken, I can't use it. **Update 5:** Starting the bounty, another 550 points to one helpful individual! **Update 6:** Some more testing has shown that this leak exists in IE6 and IE6sp1, but has been fixed in IE6sp2+. Now, about the answers I have so far... So far all answers have been any one of these: 1. Abandon IE6sp0/sp1 users or ignore them 2. Debug jquery and fix the problem myself 3. I can't repro the problem. I know beggars can't be choosers, but those simply are not answers to my problem. I cannot abandon my users. They make up 25% of the userbase. This is a custom app written for a customer, designed to work on IE6. *It is not an option to abandon IE6sp0/sp1.* It's not an option to tell my customers to just deal with it. It leaks so fast that after five minutes, some of the weaker machines are unusable. Further, while I'd love to become a JS ninja so I can hunt down obscure memory leaks in jquery code (granted this is MS's fault, not jquery's), I don't see that happening either. Finally, multiple people have reproduced the problem here and on the mailing list. If you can't repro it, you might have IE6SP2+, or you might not be refreshing enough. Obviously this issue is very important to me (hence the 6 revisions, bounty, etc.) so I'm open to new ideas, but please keep in mind that none of those three suggestions will work for me. Thanks to all for your consideration and insights. Please keep them coming! **Update 7:** The bounty has ended and Keith's answer was auto-accepted by SO. I'm sorry that only half the points were awarded (since I didn't select the answer myself), but I'm still really stuck so I think half is fair. I am hopeful that the jquery/jquery-ui team can fix this problem but I'm afraid that I'll have to write this off as "impossible (for now)" and stop using some or all of jquery. Thanks to everyone for your help and consideration. If someone comes along with a real solution to my problem, please post and I'll figure out some way to reward you. [1]: http://jsbin.com/omoya [2]: http://www.picvault.info/images/537090308_omoya.png [3]: http://www.mail-archive.com/jquery-dev@googlegroups.com/msg03851.html [4]: http://groups.google.com/group/jquery-ui/browse_thread/thread/d0093cf0199e26b4/acd3cecae3f5b055?hl=en&lnk=gst&q=dialog+memory+leak#acd3cecae3f5b055 [5]: http://i.stack.imgur.com/6pmp5.png [6]: http://dev.jqueryui.com/ticket/4644 [7]: http://groups.google.com/group/jquery-dev/browse_thread/thread/861282378f94a37e

以上就是How can I control IE6+jQuery+jQuery-ui memory leaks?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏