Fleegix.org

Memory leakage in IE

2005-09-02 14:45:00

Doing a little reading today about memory leaks in IE with complex JavaScript applications. I want to make sure Scooby's front-end code doesn't end up with any ugly, hard-to-track-down leakage. Does anybody know if Firefox or Safari suffers from this kind of stuff? I found a really good post about this from Mishoo that does a good job of explaining the issue in plain English.

The problem is simply this:

IE also, will detect and correctly remove objects creating circular references, except when one or more of those objects are DOM nodes or ActiveX objects.

That, and of course -- closures. You gotta love IE. I have a new saying: "IE 6 is the new Netscape 4."

The MSDN mothership also pointed me also to a nice article explaining how script garbage-collectors work. Apparently JScript's GC is a 'nongenerational mark-and-sweep garbage collector.'

That was not terribly helpful to me until I could find out what a 'generational' collector is. Apparently generational garbage collection is "Based on the observation that most objects have short lifetimes, it is useful to restrict garbage collection to the most recently allocated objects." I was able to find that info, and a lot of other good stuff about GCs at the GC FAQ.

About

This is the blog for Matthew Eernisse. I currently work at Yammer as a developer, working mostly with JavaScript. All opinions expressed here are my own, not my employer's.

Related

Previous posts

All previous posts ยป

This blog is a GeddyJS application.