A warning to all:
Having Skype installed triggers *huge* memory leaks in Internet Explorer 7 on Windows (possibly other versions) if the webpage you are viewing uses Ajax/DOM commands to load/unload Flash/Flex content that use ExternalInterface commands.
At this writing the only known fix is to tell your users to disable Skype.
Some testers have reported improved results by upgrading Skype to 3.8.0.154 (released August 14th, 2008) or later, although the memory leak seems to persist to some degree.
The core problem (we think) is a bug in IE: If any javascript var has a reference to a Flash/Flex app, and that app is removed from the page using Ajax-style DOM commands (innerHTML, removeChild, etc.), the javascript reference to the app remains, preventing garbage collection and triggering a memory leak. The SWF will then remain in memory, even on a full page refresh.
Traditionally, the solution (as used by SWFObject 2.1, which first solved the IE bug) is to destroy all scripts and functions within the object/embed that displays the flash/flex app,
prior to physically removing the element:
ActionScript Code:
function removeObjectInIE(id) {
var obj = getElementById(id);
if (obj) {
for (var i in obj) {
if (typeof obj[i] == "function") {
obj[i] = null;
}
}
obj.parentNode.removeChild(obj);
}
}
This effectively kills any reference that ExternalInterfaces may have created, allowing a removed flash app to garbage-collect.
This solution does not appear to work for Skype, however, which injects about a dozen javascript functions and variables into every page you visit. Several of these javascripts contain references to various page objects. Since these references exist outside of the Flash/Flex element, they are not cleaned by traditional cleaner functions and thus trigger the memory leak.
Verified in Skype 3.8.0.134. Appears to be at least
partially fixed in the August 14th, 2008 release of Skype (3.8.0.154) and in the beta for Skype 4.0, but we're still looking into it.
The bigger question is
WHY is Skype making a javascript reference to every Flash app on every page I visit? Sounds a little bit like spyware to me...