Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE9 memory leaks #513

Closed
jfroffice opened this issue Feb 29, 2012 · 20 comments
Closed

IE9 memory leaks #513

jfroffice opened this issue Feb 29, 2012 · 20 comments

Comments

@jfroffice
Copy link

You can find the test page here:
http://jsfiddle.net/d2UEB/39/show/

The code :
http://jsfiddle.net/d2UEB/39

This Bug does not occur when using default custom & minimize version.

@paulirish
Copy link
Member

@ryanseddon verified...

So issue #513 is kinda a problem, I can confirm that the dev file does have a memory leak the ram usage increases by about 15-20mb per refresh so I guess uglifyjs must be fixing the issue when it's built.

@jfroffice
Copy link
Author

Thank you for your reply.

I though that it could be a special test that might cause the memory leak. But for now, I do not find the real cause. As you say, UglifyJS seems to fix the leakage.

@ryanseddon
Copy link
Member

Ok so this is interesting, I dug a little deeper to see what could be causing the dev file to leak compared to the your build. So the first bit I tried was removing the geolocation test, and that stops the memory leaks for me in IE9 win7. It'll hover around 25mb and won't creep up.

Can you confirm this behaviour too.

Full dev build: http://jsfiddle.net/ryanseddon/d2UEB/42/show/ (this creeps up around 3-5mb per refresh)

Full dev build with no geolocation: http://jsfiddle.net/ryanseddon/d2UEB/43/show/

I killed the iexplorer process before testing each fiddle and only had one tab open at a time.

@paulirish
Copy link
Member

whoaaaaa.. that's a bug alright.

wow.

@jfroffice
Copy link
Author

@ryanseddon ... I also confirm this behaviour.

Full dev build: http://jsfiddle.net/ryanseddon/d2UEB/42/show/ (this creeps up around 3-5mb per refresh)
Full dev build with no geolocation: http://jsfiddle.net/ryanseddon/d2UEB/43/show/ (stay around 25mb and won't creep up)

I test with IE version: 9.0.8112.16421

A quick diff shows that :

/**
     * geolocation tests for the new Geolocation API specification.
     *   This test is a standards compliant-only test; for more complete
     *   testing, including a Google Gears fallback, please see:
     *   code.google.com/p/geo-location-javascript/
     * or view a fallback solution using google's geo API:
     *   gist.github.com/366184
     */
    tests['geolocation'] = function() {
             return !!navigator.geolocation;
    };

geolocation is buggy in IE9. Whoaaaa...

@leodutra
Copy link

leodutra commented Mar 5, 2012

Humm... I'm going to my work now. But someone should report it for MS.
This is ridiculous...

@ryanseddon
Copy link
Member

Filed a bug on the ever annoying IE connect website https://connect.microsoft.com/IE/feedback/details/728942/geolocation-causes-memory-leak-in-ie9

@leodutra
Copy link

leodutra commented Mar 6, 2012

Good job dude.
The bad part is... I'm still working and they want me to login to see a freak bug.
Hail to MS, always conquering the magic F*ck Off Lands.

@paulirish
Copy link
Member

in summary this is all that causes the bug:

!!navigator.geolocation;

So this will cause the leak for anyone checking geolocation in IE9. This is not isolated to Modernizr.

FYI!


screenshot of the IE Connect filing because who wants to log into that mess?!

@leodutra
Copy link

leodutra commented Mar 6, 2012

Wow! Thanks Paul.
Only the best ninjas of the JavaScript can save us from "MicroShift".

And congrats for Modernizr!

@paulirish
Copy link
Member

It was all Ryan. 👲

@staabm
Copy link

staabm commented Mar 6, 2012

/cc

@ryanseddon
Copy link
Member

Got confirmation from MS that it can be reproduced by them and strangely in IE10PP5, PP4 was fine for me. IE9 was the only one leaking on my end.

@paulirish
Copy link
Member

So we just changed the geolocation check to avoid a webkit page caching issue.

see recent commit from @josh

its now 'geolocation' in navigator .. i wonder if that triggers the mem leak here.

@paulirish
Copy link
Member

just tested with http://jsfiddle.net/d2UEB/46/show/ and things look great! no leak with josh's new test. boom

@ryanseddon
Copy link
Member

I though I was seeing a massively reduced leak still but it seems to of stabilised around 33mb on a fresh start with the above testcase running. Boom indeed.

@josh
Copy link
Contributor

josh commented Apr 16, 2012

🤘

@jfroffice
Copy link
Author

works for me.

great news !

@ryanseddon
Copy link
Member

Got a response that this issue has been fixed in IE10PP6

@MarkPieszak
Copy link

Your the man Paul, had this exact issue today (I'm using 1.7), changed the return statement and the memory leak is no more! Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants