Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I control IE6+jQuery+jQuery-ui memory leaks?
    text
    copied!<p>Here's a <a href="http://jsbin.com/omoya" rel="nofollow noreferrer">sample page</a> with a couple datepickers. Here's the Drip result for that:</p> <p><a href="http://www.picvault.info/images/537090308_omoya.png" rel="nofollow noreferrer">alt text http://www.picvault.info/images/537090308_omoya.png</a></p> <p>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.</p> <p>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 (<a href="http://www.mail-archive.com/jquery-dev@googlegroups.com/msg03851.html" rel="nofollow noreferrer">CollectGarbage</a>, <a href="http://groups.google.com/group/jquery-ui/browse_thread/thread/d0093cf0199e26b4/acd3cecae3f5b055?hl=en&amp;lnk=gst&amp;q=dialog+memory+leak#acd3cecae3f5b055" rel="nofollow noreferrer">AntiLeak</a>, others).</p> <p>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!</p> <p><strong>Update 1:</strong> I added that button event to a loop and this is what happens (the sudden drop off is when I terminate IE): <img src="https://i.stack.imgur.com/6pmp5.png" alt="alt text"></p> <p><strong>Update 2:</strong> I filed a <a href="http://dev.jqueryui.com/ticket/4644" rel="nofollow noreferrer">bug report</a> (fingers crossed).</p> <p><strong>Update 3:</strong> This is also on the <a href="http://groups.google.com/group/jquery-dev/browse_thread/thread/861282378f94a37e" rel="nofollow noreferrer">mailing list</a>.</p> <p><strong>Update 4:</strong> This (as reported on the mailing list) doesn't work, and in fact makes things worse:</p> <pre><code>$(window).bind("unload", function() { $('.hasDatepicker').datepicker('destroy'); $(window).unbind(); }); </code></pre> <p>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.</p> <p><strong>Update 5:</strong> Starting the bounty, another 550 points to one helpful individual!</p> <p><strong>Update 6:</strong> 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...</p> <p>So far all answers have been any one of these:</p> <ol> <li>Abandon IE6sp0/sp1 users or ignore them</li> <li>Debug jquery and fix the problem myself</li> <li>I can't repro the problem.</li> </ol> <p>I know beggars can't be choosers, but those simply are not answers to my problem.</p> <p>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. <em>It is not an option to abandon IE6sp0/sp1.</em> 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.</p> <p>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. </p> <p>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.</p> <p>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.</p> <p>Thanks to all for your consideration and insights. Please keep them coming!</p> <p><strong>Update 7:</strong> 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. </p> <p>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.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload