Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE9 memory leak

I'm noticing, in my app, the memory associated with the IE process on Win7 climbs by 20-30 MB with each page refresh. Once I reach about 1.5 GB, the browser becomes unresponsive. I'm using IE9, and can only reproduce this in IE9. No such issue in Chrome, FF, IE7, or IE8. In fact, the issue also does not occur when running IE9 in compatibility mode.

In particular, I'm wondering how memory could leak even after a page refresh. Has anyone else seen this?

like image 922
Ray Nicholus Avatar asked May 15 '12 18:05

Ray Nicholus


1 Answers

I'm not sure if this would be your issue, but I was also getting this IE9 memory leak issue where the memory kept growing and growing (about 20mgs per refresh / page change).

If you are using Modernizr (this should be fixed now in one of the very recent releases, 2.5+ I believe), but if you are using an older version (and can't just update it for any reason) then all you need to do is replace one return statement.

The problem is occurring with Modernizr / Geolocation & IE9, it is actually an inherit issue with IE9, not so much Modernizr.

return 'geolocation' in navigator

instead of:

return !!navigator.geolocation // this causes the memory leak (silly IE9)

https://github.com/Modernizr/Modernizr/issues/513

Take a look at that link, but basically the return statement for the Geolocation test needs to be changed, and this problem will fix itself!

like image 70
Mark Pieszak - Trilon.io Avatar answered Sep 20 '22 12:09

Mark Pieszak - Trilon.io