<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Is &#8220;finally&#8221; the answer to all IE6 memory leak issues?</title>
	<atom:link href="http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Naruto</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-268042</link>
		<dc:creator>Naruto</dc:creator>
		<pubDate>Thu, 09 Oct 2008 21:29:17 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-268042</guid>
		<description>Thank for the info</description>
		<content:encoded><![CDATA[<p>Thank for the info</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264997</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Wed, 11 Jun 2008 15:48:51 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264997</guid>
		<description>@Jordan
That&#039;s pretty cute.</description>
		<content:encoded><![CDATA[<p>@Jordan<br />
That&#8217;s pretty cute.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fredrik</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264989</link>
		<dc:creator>Fredrik</dc:creator>
		<pubDate>Wed, 11 Jun 2008 07:34:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264989</guid>
		<description>@Geompse:
AFAIU your code example doesn&#039;t leak, thus you don&#039;t need any of the tricks above. It&#039;s only when you created a closure that also &quot;consumes&quot; a DOM-element you need to do nulling.</description>
		<content:encoded><![CDATA[<p>@Geompse:<br />
AFAIU your code example doesn&#8217;t leak, thus you don&#8217;t need any of the tricks above. It&#8217;s only when you created a closure that also &#8220;consumes&#8221; a DOM-element you need to do nulling.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geompse</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264976</link>
		<dc:creator>Geompse</dc:creator>
		<pubDate>Tue, 10 Jun 2008 21:04:25 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264976</guid>
		<description>huh, question :

function x()
{
var a = document.createElement(&#039;div&#039;);
return a;
}
function y()
{
var b = x();
return b;
}
document.body.appendChild(y());

as I understand, i shall put &quot;try{return a;} finally{a=null;}&quot; in function x. but shall i put &quot;try{return b;} finally{b=null;}&quot; in function y ?</description>
		<content:encoded><![CDATA[<p>huh, question :</p>
<p>function x()<br />
{<br />
var a = document.createElement(&#8216;div&#8217;);<br />
return a;<br />
}<br />
function y()<br />
{<br />
var b = x();<br />
return b;<br />
}<br />
document.body.appendChild(y());</p>
<p>as I understand, i shall put &#8220;try{return a;} finally{a=null;}&#8221; in function x. but shall i put &#8220;try{return b;} finally{b=null;}&#8221; in function y ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264931</link>
		<dc:creator>Jordan</dc:creator>
		<pubDate>Tue, 10 Jun 2008 05:25:06 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264931</guid>
		<description>We use something like this in our company:
&lt;code&gt;
function create() {
  var a = document.createElement(&quot;div&quot;);
  a.onclick = function() {
    //...
  };
  return (a = [a]).pop();
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>We use something like this in our company:<br />
<code><br />
function create() {<br />
  var a = document.createElement("div");<br />
  a.onclick = function() {<br />
    //...<br />
  };<br />
  return (a = [a]).pop();<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264927</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Mon, 09 Jun 2008 23:07:42 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264927</guid>
		<description>It&#039;s a busy day at Zazzle (Monday&#039;s are meeting days), but I will do some more digging and hopefully report something interesting.</description>
		<content:encoded><![CDATA[<p>It&#8217;s a busy day at Zazzle (Monday&#8217;s are meeting days), but I will do some more digging and hopefully report something interesting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264926</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Mon, 09 Jun 2008 23:06:33 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264926</guid>
		<description>@jgw
Drip was used to test leaking in IE6 - not IE7. Also the hash table is not a global variable, but stored as a property of a global object. That particular pattern, at the time, resulted in Drip reporting no leaked DOM elements, and the memory usage of IE6 not creeping up uncontrollably on each subsequent page refresh.</description>
		<content:encoded><![CDATA[<p>@jgw<br />
Drip was used to test leaking in IE6 &#8211; not IE7. Also the hash table is not a global variable, but stored as a property of a global object. That particular pattern, at the time, resulted in Drip reporting no leaked DOM elements, and the memory usage of IE6 not creeping up uncontrollably on each subsequent page refresh.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fredrik</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264923</link>
		<dc:creator>Fredrik</dc:creator>
		<pubDate>Mon, 09 Jun 2008 22:42:26 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264923</guid>
		<description>Isn&#039;t a local factory just as good?
function createDOMThingy()
{
    function createAndHookup(onClick)
    {
         var elem = document.createElement(&#039;div&#039;);
         elem.onclick = onClick;
         return elem;
    }
    return createAndHookUp(function(){ alert(&#039;click!&#039;); });
}</description>
		<content:encoded><![CDATA[<p>Isn&#8217;t a local factory just as good?<br />
function createDOMThingy()<br />
{<br />
    function createAndHookup(onClick)<br />
    {<br />
         var elem = document.createElement(&#8216;div&#8217;);<br />
         elem.onclick = onClick;<br />
         return elem;<br />
    }<br />
    return createAndHookUp(function(){ alert(&#8216;click!&#8217;); });<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cromwellian</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264921</link>
		<dc:creator>cromwellian</dc:creator>
		<pubDate>Mon, 09 Jun 2008 22:08:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264921</guid>
		<description>It&#039;s not just expandos tho. If you use .onXXX, or attachEvent, the same leak will occur. It&#039;s any reachable reference from the DOM node into the JS  which causes the issue for removed/replaced elements.</description>
		<content:encoded><![CDATA[<p>It&#8217;s not just expandos tho. If you use .onXXX, or attachEvent, the same leak will occur. It&#8217;s any reachable reference from the DOM node into the JS  which causes the issue for removed/replaced elements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HedgerWang</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264918</link>
		<dc:creator>HedgerWang</dc:creator>
		<pubDate>Mon, 09 Jun 2008 21:34:49 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264918</guid>
		<description>Attaching &quot;any&quot; JS objects to a DOM element would introduce memory leak, and that&#039;s why add expando to an element is a bad idea.

After M$ had released several fixes to fix the IE memory leaks bug, it turns out that IE does remove all JS objects attached to DOM elements before the unload event is triggered as long as those DOM elements remain valid in the document tree.

For element removed or replaced (eg.document.body.innerHTML = &quot;&quot;)  from the document tree before the unload event,  IE won&#039;t be able to recycle the memory from the JS objects attached to those elements.</description>
		<content:encoded><![CDATA[<p>Attaching &#8220;any&#8221; JS objects to a DOM element would introduce memory leak, and that&#8217;s why add expando to an element is a bad idea.</p>
<p>After M$ had released several fixes to fix the IE memory leaks bug, it turns out that IE does remove all JS objects attached to DOM elements before the unload event is triggered as long as those DOM elements remain valid in the document tree.</p>
<p>For element removed or replaced (eg.document.body.innerHTML = &#8220;&#8221;)  from the document tree before the unload event,  IE won&#8217;t be able to recycle the memory from the JS objects attached to those elements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jgw</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264916</link>
		<dc:creator>jgw</dc:creator>
		<pubDate>Mon, 09 Jun 2008 21:00:05 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264916</guid>
		<description>The problem with that approach is that you now have the following reference chain: { handlerFunction -&gt; hashTable -&gt; trueHandlerFunction -&gt; element }. If the hashTable is simply a global, then the handlerFunction still has an implicit reference to it (by virtue of the fact that everyone has an implicit reference to the global scope). This is generally not a big deal with a simple handler function, but if that handler has a reference to a more complex &quot;peer&quot; javascript object (very common in UI frameworks), then the leak can be much larger.

It is possible that Drip is showing that you have no leaks, because IE (7, at least) cleans up event handlers it can find in the DOM on unload. Drip can only check for leaks present *after* the page is fully done unloading (I wrote Drip a few years ago, but haven&#039;t really maintained it much since).</description>
		<content:encoded><![CDATA[<p>The problem with that approach is that you now have the following reference chain: { handlerFunction -&gt; hashTable -&gt; trueHandlerFunction -&gt; element }. If the hashTable is simply a global, then the handlerFunction still has an implicit reference to it (by virtue of the fact that everyone has an implicit reference to the global scope). This is generally not a big deal with a simple handler function, but if that handler has a reference to a more complex &#8220;peer&#8221; javascript object (very common in UI frameworks), then the leak can be much larger.</p>
<p>It is possible that Drip is showing that you have no leaks, because IE (7, at least) cleans up event handlers it can find in the DOM on unload. Drip can only check for leaks present *after* the page is fully done unloading (I wrote Drip a few years ago, but haven&#8217;t really maintained it much since).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264915</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Mon, 09 Jun 2008 20:33:36 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264915</guid>
		<description>The trick is to break the *reference* chain. If the event handler that is directly assigned to the DOM node has a string variable (closure scoped) that contains a key which it can use to look up a true handler in a hash table, then the handler does *not* have a reference to the true handler function. Therefore, the DOM node does not have a reference to the true handler function. In all likelihood the true handler function hangs on to a reference to the DOM node, but this is OK because there is now no circular reference taking place.
&#160;
It was a long time ago that I solved this problem and made a test to verify that it worked. I was using a little utlility called Drip at the time that indicated that with the CRIS in place, there were no leaked DOM nodes across page refreshes. Needless to say, it was a relief to solve this problem in an elegant way. Prior to this, UIZE had a workaround for IE6 where cleanup would happen on page unload (the traditional way). I remember that the key thing was to keep the direct handler function definition outside of a scope which held a closure reference to the hash table.</description>
		<content:encoded><![CDATA[<p>The trick is to break the *reference* chain. If the event handler that is directly assigned to the DOM node has a string variable (closure scoped) that contains a key which it can use to look up a true handler in a hash table, then the handler does *not* have a reference to the true handler function. Therefore, the DOM node does not have a reference to the true handler function. In all likelihood the true handler function hangs on to a reference to the DOM node, but this is OK because there is now no circular reference taking place.<br />
&nbsp;<br />
It was a long time ago that I solved this problem and made a test to verify that it worked. I was using a little utlility called Drip at the time that indicated that with the CRIS in place, there were no leaked DOM nodes across page refreshes. Needless to say, it was a relief to solve this problem in an elegant way. Prior to this, UIZE had a workaround for IE6 where cleanup would happen on page unload (the traditional way). I remember that the key thing was to keep the direct handler function definition outside of a scope which held a closure reference to the hash table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jgw</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264914</link>
		<dc:creator>jgw</dc:creator>
		<pubDate>Mon, 09 Jun 2008 20:05:55 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264914</guid>
		<description>Cromwellian&#039;s comments (hi, Ray!) are pretty much right on the money. No amount of indirection through hash tables or any other mechanism will change the fact that you&#039;ve got a circular reference. Think about it this way: If I&#039;ve got a Javascript object that references a DOM element, and it&#039;s possible to reach that object *in any way* from the DOM element (including its event handlers), then you&#039;ve got an uncollectible circular reference in IE. This can only be fixed by breaking the circular reference at some point before the page unloads, and once you do so, whatever was depending on that reference (e.g. being able to handle events correctly) will no longer work.

The trick described in this article works for the sole reason that the only circular reference involved is { functionScope -&gt; element -&gt; eventHandler -&gt; closure -&gt; functionScope }. The finally block just clears out the { functionScope -&gt; element } part of the reference after the return value is computed. This in no way solves the general problem described above. The only general solution is to break circular references when an element is &quot;disposed&quot; (i.e. whenever it is no longer needed by the app, and before the page unloads).</description>
		<content:encoded><![CDATA[<p>Cromwellian&#8217;s comments (hi, Ray!) are pretty much right on the money. No amount of indirection through hash tables or any other mechanism will change the fact that you&#8217;ve got a circular reference. Think about it this way: If I&#8217;ve got a Javascript object that references a DOM element, and it&#8217;s possible to reach that object *in any way* from the DOM element (including its event handlers), then you&#8217;ve got an uncollectible circular reference in IE. This can only be fixed by breaking the circular reference at some point before the page unloads, and once you do so, whatever was depending on that reference (e.g. being able to handle events correctly) will no longer work.</p>
<p>The trick described in this article works for the sole reason that the only circular reference involved is { functionScope -&gt; element -&gt; eventHandler -&gt; closure -&gt; functionScope }. The finally block just clears out the { functionScope -&gt; element } part of the reference after the return value is computed. This in no way solves the general problem described above. The only general solution is to break circular references when an element is &#8220;disposed&#8221; (i.e. whenever it is no longer needed by the app, and before the page unloads).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nosredna</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264913</link>
		<dc:creator>Nosredna</dc:creator>
		<pubDate>Mon, 09 Jun 2008 19:33:51 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264913</guid>
		<description>&gt;&gt;We need to make sure that the people USING IE6 know that it is garbage.

They often do know it. Many of them work at places where IT has mandated IE6. These are often oppressive places to work, and telling the user that the browser sucks is just adding to the punishment they already endure.

You have to decide if it&#039;s worth dealing with IE6 or not. A local newspaper&#039;s site stopped working on IE6 recently. The programmers get the complain calls forwarded to them (something like 20% of the users had been on IE6 still), and they have to explain on the phone that IE6 is no longer supported. That seems like a great way to alienate your customers to me.

I&#039;d LOVE it if IE6 went away. It uss up probably half my browser-specific time. It&#039;ll be a big win when I can drop it.</description>
		<content:encoded><![CDATA[<p>&gt;&gt;We need to make sure that the people USING IE6 know that it is garbage.</p>
<p>They often do know it. Many of them work at places where IT has mandated IE6. These are often oppressive places to work, and telling the user that the browser sucks is just adding to the punishment they already endure.</p>
<p>You have to decide if it&#8217;s worth dealing with IE6 or not. A local newspaper&#8217;s site stopped working on IE6 recently. The programmers get the complain calls forwarded to them (something like 20% of the users had been on IE6 still), and they have to explain on the phone that IE6 is no longer supported. That seems like a great way to alienate your customers to me.</p>
<p>I&#8217;d LOVE it if IE6 went away. It uss up probably half my browser-specific time. It&#8217;ll be a big win when I can drop it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cromwellian</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264912</link>
		<dc:creator>cromwellian</dc:creator>
		<pubDate>Mon, 09 Jun 2008 19:08:42 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264912</guid>
		<description>I&#039;ve talked to people who have implemented CRIS style stuff before, it&#039;s a fairly obvious workaround, but AFAIK, it doesn&#039;t work perfectly either. The GC shouldn&#039;t care whether references are direct or indirect with respect to cycles. If an element has a reference to another JS object, which references another, which eventually references the original element, you have a cycle. There&#039;s nothing special about A-&gt;B-&gt;A vs A-&gt;B-&gt;C-&gt;A. It shouldn&#039;t matter if C is a direct reference, or a hash table with a bunch of references, one of whom happens to be A.

AFAIK, no framework that doesn&#039;t track unattached DOM elements and clean them up on page load (or unattachment) can avoid leaking.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve talked to people who have implemented CRIS style stuff before, it&#8217;s a fairly obvious workaround, but AFAIK, it doesn&#8217;t work perfectly either. The GC shouldn&#8217;t care whether references are direct or indirect with respect to cycles. If an element has a reference to another JS object, which references another, which eventually references the original element, you have a cycle. There&#8217;s nothing special about A-&gt;B-&gt;A vs A-&gt;B-&gt;C-&gt;A. It shouldn&#8217;t matter if C is a direct reference, or a hash table with a bunch of references, one of whom happens to be A.</p>
<p>AFAIK, no framework that doesn&#8217;t track unattached DOM elements and clean them up on page load (or unattachment) can avoid leaking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264911</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Mon, 09 Jun 2008 19:04:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264911</guid>
		<description>@Bryan,
So, what you&#039;re saying is that IE6 is in need of some garbage collection ;-)</description>
		<content:encoded><![CDATA[<p>@Bryan,<br />
So, what you&#8217;re saying is that IE6 is in need of some garbage collection ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: polterguy</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264910</link>
		<dc:creator>polterguy</dc:creator>
		<pubDate>Mon, 09 Jun 2008 18:58:07 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264910</guid>
		<description>Here&#039;s another solution that will completely eliminate the entire stack of problems; 
http://ajaxwidgets.com/Blogs/thomas/the_entire_web_is__best_viewed.bb
;)</description>
		<content:encoded><![CDATA[<p>Here&#8217;s another solution that will completely eliminate the entire stack of problems;<br />
<a href="http://ajaxwidgets.com/Blogs/thomas/the_entire_web_is__best_viewed.bb" rel="nofollow">http://ajaxwidgets.com/Blogs/thomas/the_entire_web_is__best_viewed.bb</a><br />
;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264909</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Mon, 09 Jun 2008 18:56:40 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264909</guid>
		<description>Why bother fixing IE6 issues?  Yes, I know it is still being used heavily, but the issue remains.  IE6 is garbage and we all know it - thats why we &quot;fix&quot; it all the time with CSS and JS hacks.  

We need to make sure that the people USING IE6 know that it is garbage.  From their point of view - &quot;if it ain&#039;t broke, dont fix it&quot; so they may never upgrade.  

While this is an interesting hack, the focus shouldn&#039;t be on saving IE6 it should be on eliminating it and making sure that the end users know that they have better options.</description>
		<content:encoded><![CDATA[<p>Why bother fixing IE6 issues?  Yes, I know it is still being used heavily, but the issue remains.  IE6 is garbage and we all know it &#8211; thats why we &#8220;fix&#8221; it all the time with CSS and JS hacks.  </p>
<p>We need to make sure that the people USING IE6 know that it is garbage.  From their point of view &#8211; &#8220;if it ain&#8217;t broke, dont fix it&#8221; so they may never upgrade.  </p>
<p>While this is an interesting hack, the focus shouldn&#8217;t be on saving IE6 it should be on eliminating it and making sure that the end users know that they have better options.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264908</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Mon, 09 Jun 2008 18:49:50 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264908</guid>
		<description>One way to avoid circular reference related DOM memory leaks in IE6 is to institute a CRIS (Circular Reference Isolation System). Your framework should provide methods for abstracting the assignment and removal of event handlers on DOM nodes. With such an abstraction, you can institute a CRIS to enforce a breakage in the circular reference between referenced DOM nodes and lambda closures that would implicitly be linked by reference to the DOM nodes.
&#160;
Basically, the DOM node has a reference to the closure function (the event handler). The closure function has a reference to the state of its enclosing scope, which has a variable that is a reference to the DOM node. IE6 doesn&#039;t identify and resolve circular references that span the JS/DOM divide.
&#160;
A CRIS works by assigning an intermediary &quot;joiner&quot; function as the actual event handler of the DOM node, and ensures that this intermediary function does not have a direct reference to the handler function being assigned by the application. Instead, the real handler is looked up from a hash table, using a key that is stored through closure with intermediary. This effectively breaks the direct reference chain, so IE6 doesn&#039;t hang on to DOM nodes. To the application developer, everything behaves the way they would like. They can assigned closure functions as event handlers without worrying about circular references.
&#160;
PLUG (of course, you knew it was coming): The UIZE JavaScript Framework employs a CRIS in its Uize.Node package, so that the event handler methods ensure no circular references that would lead to DOM memory leaks in IE6.</description>
		<content:encoded><![CDATA[<p>One way to avoid circular reference related DOM memory leaks in IE6 is to institute a CRIS (Circular Reference Isolation System). Your framework should provide methods for abstracting the assignment and removal of event handlers on DOM nodes. With such an abstraction, you can institute a CRIS to enforce a breakage in the circular reference between referenced DOM nodes and lambda closures that would implicitly be linked by reference to the DOM nodes.<br />
&nbsp;<br />
Basically, the DOM node has a reference to the closure function (the event handler). The closure function has a reference to the state of its enclosing scope, which has a variable that is a reference to the DOM node. IE6 doesn&#8217;t identify and resolve circular references that span the JS/DOM divide.<br />
&nbsp;<br />
A CRIS works by assigning an intermediary &#8220;joiner&#8221; function as the actual event handler of the DOM node, and ensures that this intermediary function does not have a direct reference to the handler function being assigned by the application. Instead, the real handler is looked up from a hash table, using a key that is stored through closure with intermediary. This effectively breaks the direct reference chain, so IE6 doesn&#8217;t hang on to DOM nodes. To the application developer, everything behaves the way they would like. They can assigned closure functions as event handlers without worrying about circular references.<br />
&nbsp;<br />
PLUG (of course, you knew it was coming): The UIZE JavaScript Framework employs a CRIS in its Uize.Node package, so that the event handler methods ensure no circular references that would lead to DOM memory leaks in IE6.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spocke</title>
		<link>http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues/comment-page-1#comment-264907</link>
		<dc:creator>Spocke</dc:creator>
		<pubDate>Mon, 09 Jun 2008 18:33:50 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/is-finally-the-answer-to-all-ie6-memory-leak-issues#comment-264907</guid>
		<description>I played around with this finally approach tested it in sIEve and it does really seem to solve the circular reference memory leak. Very strange that it works. However it doesn&#039;t directly solve the circular reference problem that the attachEvent method in IE introduces so I wrote a small proof of concept class that fakes this behavior.

I verified that it doesn&#039;t leak in IE using sIEve and it works in all browsers:
http://blog.moxiecode.com/2008/06/09/leak-free-event-class-that-doesnt-use-the-unload-event/</description>
		<content:encoded><![CDATA[<p>I played around with this finally approach tested it in sIEve and it does really seem to solve the circular reference memory leak. Very strange that it works. However it doesn&#8217;t directly solve the circular reference problem that the attachEvent method in IE introduces so I wrote a small proof of concept class that fakes this behavior.</p>
<p>I verified that it doesn&#8217;t leak in IE using sIEve and it works in all browsers:<br />
<a href="http://blog.moxiecode.com/2008/06/09/leak-free-event-class-that-doesnt-use-the-unload-event/" rel="nofollow">http://blog.moxiecode.com/2008/06/09/leak-free-event-class-that-doesnt-use-the-unload-event/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

