Search and Top Navigation
#8164 closed bug (patcheswelcome)
Opened March 06, 2012 01:59PM UTC
Closed April 19, 2016 01:15PM UTC
Memory Leak using IE8/9 with datepicker and frameset
Reported by: | gianlucamaggio | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.datepicker | Version: | 1.8.18 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I have a memory leak (memory not released after page exit) using jQuery UI in a page inside a FRAME of a FRAMESET by simply including jquery-ui-1.8.18.custom.min.js. I cannot post to jsFiddle because I need two pages to reproduce it.
The page reload itself each 100ms to show how quickly the memory increase.
I have the problem only with jQuery 1.8. No problem with jQuery 1.7.
This is the code of Home.html:
<!doctype html /> <html> <frameset cols="100,*" target="cfmain" frameborder=yes framespacing=0 hidefocus > <frame name="cfmonitor" id="cfmonitor" src="about:blank" scrolling="yes" noresize> <frame name="cfmain" id="cfmain" src="testjq.html" > </frameset> </html>
And this is the code of the contained page (testjq.html):
<!DOCTYPE html /> <html> <head> <script src="JQuery/jquery-1.7.1.min.js" type="text/javascript"></script> <script src="JQuery/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script> <LINK REL="stylesheet" HREF="JQuery/themes/cupertino/jquery-ui-1.8.18.custom.css"> <title>JQuery Test Page </title> <script language="javascript"> $(function () { window.setTimeout("window.location.href = 'Testjq.html'", 100); }); </script> </head> <body > <h1>simple test</h1> <h2>Reloading...</h2> </body> </html>
This is the memory running with IE8 on Windows 2008 (the same also in IE9 Win7)
[[Image(http://s10.postimage.org/5ketngvyx/Memory_Leak.jpg)]]
Attachments (0)
Change History (10)
Changed March 22, 2012 07:26PM UTC by comment:1
Changed May 08, 2012 09:51PM UTC by comment:2
component: | ui.core → ui.datepicker |
---|---|
summary: | Memory Leak using IE8/9 with jquery UI and FRAMESET → Memory Leak using IE8/9 with datepicker and frameset |
Changed July 06, 2012 02:23PM UTC by comment:3
Hi,
we had also the same problem. Function bindHover(dpDiv) seems to be the problem.
Our solution is to return dbDiv without register the mouse events.
For us it's enought.
Bye Alex
Changed September 12, 2012 07:21PM UTC by comment:4
Following up on Allex's comment, if you still need hovering you can change the delegate to using .live() like this:
var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; $(selector).live('mouseout', function(){ $(this).removeClass('ui-state-hover'); if (this.className.indexOf('ui-datepicker-prev') != -1){ $(this).removeClass('ui-datepicker-prev-hover'); } if (this.className.indexOf('ui-datepicker-next') != -1){ $(this).removeClass('ui-datepicker-next-hover'); } }).live('mouseover', function(){ if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) { $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); $(this).addClass('ui-state-hover'); if (this.className.indexOf('ui-datepicker-prev') != -1){ $(this).addClass('ui-datepicker-prev-hover'); } if (this.className.indexOf('ui-datepicker-next') != -1){ $(this).addClass('ui-datepicker-next-hover'); } } }); return dpDiv;
This stops on-load leaking in at least IE8 but leaves hovering apparently functioning at the cost of some (significant) CPU overhead.
Changed October 11, 2012 02:45PM UTC by comment:5
milestone: | 1.9.0 → 1.11.0 |
---|
Changed October 19, 2012 08:18PM UTC by comment:6
status: | new → open |
---|
Changed January 29, 2013 05:06PM UTC by comment:7
Hi there,
Is there a plan on fixing this memory leak in IE 8/9 ?
Thanks
Changed January 29, 2013 05:25PM UTC by comment:8
Sure, send a pull request. Otherwise, it probably won't happen until the rewrite lands in master.
Changed June 24, 2014 11:52PM UTC by comment:9
milestone: | 1.11.0 → none |
---|
Changed April 19, 2016 01:15PM UTC by comment:10
resolution: | → patcheswelcome |
---|---|
status: | open → closed |
I'm going to close this since we're very far along in the rewrite. Since none of the existing code exists in the rewrite, this particular bug won't persist.
I am seeing the exact same problem.
I have tracked this down to the jquery.ui.datepicker changes introduced in 1.8.13. This example will not leak in 1.8.12 but it will leak in 1.8.13. If you take the 1.8.12 source and add the 1.8.13 datepicker changes it begins to leak. I'm not confident enough in these changes to understand what exactly is causing the leak yet - other than IE and framesets ;)