1. 9
  1.  

  2. 1

    An unfortunate side effect of closures is that they make it trivially easy to leak memory in Internet Explorer

    Even newer versions?

    1. 2

      No. (http://msdn.microsoft.com/en-us/library/dd361842.aspx)

      I think the article was written in 2006 and is pretty out of date.

      1. 1

        Assuming it’s still true, I’d say it’s mitigated by per-process tabs. I’m surprised though that each page doesn’t have its own arena. I can understand how DOM and JS objects get tangled together and can’t be collected, but it seems easy (always does) to just blow away both the DOM and JS heaps for a page after you navigate sufficiently far away. (After reading the msdn link, it seems even IE 7 does just that. It’s only a leak while on the page.)

        (What’s the longest running web page? gmail? Would evil google deliberately add lots of DOM closure leaks to gmail to convince people to use chrome? :))

        As a side note, closures/lambdas/anonymous functions are where lots of languages' GCs break down. luajit will permanently pin any function passed as a function pointer to C, and the jvm has similar issues with permgen.