faheem801 / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

Memory Leak IE8 #387

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I'm trying to use Flot to plot live data in IE8 on Windows XP SP3. I am using 
setInterval() to call $.plot() frequently (500-1000ms).

I am using Flot 0.6 from trunk.

I've cut it down to a pretty simple example (see attached). The example is 
using Flot from trunk. I also included and tested with Excanvas r73 (latest 
from their trunk) and jQuery 1.4.2, combining these appears to cut down on the 
leakage a bit but it is still there.

I've been using sIEve to track the memory/DOM usage and both increase at a 
steady rate.

Original issue reported on code.google.com by tom9...@gmail.com on 28 Jul 2010 at 3:26

Attachments:

GoogleCodeExporter commented 9 years ago
I've attached a short patch against r263 that appears to fix this for me.

Original comment by tom9...@gmail.com on 28 Jul 2010 at 6:19

Attachments:

GoogleCodeExporter commented 9 years ago
It seems to be this bug:

http://code.google.com/p/explorercanvas/issues/detail?id=82

Regarding the patch: we can't just remove the init_ call, it'll introduce a 
race condition:

http://code.google.com/p/explorercanvas/issues/detail?id=30

But I've add a fix based on your patch to SVN (please do them with -u in the 
future by the way, it's easier to read them that way :). Would you mind seeing 
if it does the trick for you?

Original comment by olau%iol...@gtempaccount.com on 14 Dec 2010 at 8:25

GoogleCodeExporter commented 9 years ago
Scrap the init_ call remark, I can see that excanvas bug is fixed.

Original comment by olau%iol...@gtempaccount.com on 16 Dec 2010 at 8:37

GoogleCodeExporter commented 9 years ago
Ole, this patch doesn't work very well for me in IE6.  If I checkout the latest 
version from SVN, copy/paste the plot call in examples/basic.html and then open 
it in IE6, I get this error:

"Line: 707
Error: Object doesn't support this action"

The line in question is:
delete this.context_;

Which is the contents of the each loop added in r284.

To be clear, all I'm doing here is calling plot twice instead of once in 
basic.html.  I know we're supposed to do the setData, setupGrid, draw thing, 
but re-calling plot probably shouldn't throw an error?

Original comment by ryl...@gmail.com on 24 Jan 2011 at 9:01

GoogleCodeExporter commented 9 years ago
I've just discovered this error and found a simple fix, as follows:

in the current SVN version of jquery.flot.js, go to line 707:

delete this.context_;

change to:

delete $(this).context_;

and it seem to work. 

I don't know the bigger picture, but given this is performed on a jQuery 
each(), it looks right to me.

Original comment by justin2...@hotmail.com on 26 Jan 2011 at 12:06

GoogleCodeExporter commented 9 years ago
ryleyb: Hm, you're right, it's not working at all in IE6. Strange. OK, let's 
try clearing it out instead. I've committed that to SVN. If you have a good 
test case for this, would you mind trying again?

justin: While that prevents IE from barfing, I think it also nullifies the fix.

Original comment by olau%iol...@gtempaccount.com on 26 Jan 2011 at 12:49

GoogleCodeExporter commented 9 years ago
Unfortunately I don't have a great test case right now... This definitely 
doesn't cause JS errors in IE6, so that's good :)

Original comment by ryl...@gmail.com on 26 Jan 2011 at 7:14

GoogleCodeExporter commented 9 years ago
If someone with the problem and testcase would report back, that would be 
awesome. :)

Original comment by olau%iol...@gtempaccount.com on 11 Mar 2011 at 12:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Still leaking. Took the latest from svn this morning (2011-03-11) and 
experienced about 5MB of leak in 10 minutes with the attached test. Using IE 
8.0.7600.16385 on Windows 7.

Original comment by doug.sue...@gmail.com on 11 Mar 2011 at 3:39

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the test case. I get the same result as you with IE6.

But that means that the change does indeed seem to improve the situation 
considerably, without it I get a leak of maybe 10 MB/minute.

If I change the $.plot call to setData and draw(), it stops leaking. There was 
a discussion somewhere that we may have to clean up some event handlers. I 
think I'll merge this with that issue.

Good work guys, thanks!

Original comment by olau%iol...@gtempaccount.com on 11 Mar 2011 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by dnsch...@gmail.com on 7 May 2012 at 11:29