Skip to content
This repository

IE9 memory leaks #513

Closed
jfroffice opened this Issue February 29, 2012 · 20 comments

7 participants

J.Fischer Paul Irish Ryan Seddon Leonardo Dutra Markus Staab Joshua Peek mcpDESIGNS
J.Fischer

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.

Paul Irish
Owner

@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.

J.Fischer

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.

Ryan Seddon
Owner

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.

Paul Irish
Owner
J.Fischer

@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...

Leonardo Dutra

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

Leonardo Dutra

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.

Paul Irish
Owner

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?!

Leonardo Dutra

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

And congrats for Modernizr!

Paul Irish
Owner
Markus Staab

/cc

Ryan Seddon
Owner

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.

Paul Irish
Owner

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.

Paul Irish
Owner

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

Ryan Seddon
Owner

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.

Joshua Peek
josh commented April 15, 2012

:metal:

J.Fischer jfroffice closed this April 15, 2012
J.Fischer

works for me.

great news !

Ryan Seddon
Owner

Got a response that this issue has been fixed in IE10PP6

mcpDESIGNS

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
Something went wrong with that request. Please try again.