Re: IE6 memory leak - very fiddly
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Fri, 21 Nov 2008 18:38:27 +0100
Daniel Orner wrote:
Thomas 'PointedEars' Lahn wrote:
<snip>
Sigh. [psf 10.1]
You should not simply snip what is being referred to in the quoted text, in
order to preserve the context of what you quoted, of course. (Snipping is
only indicated if what you snipped is not relevant to the reply at all.) If
the target of the reference is too large to be quoted, you should summarize
it or only quote the parts of it that are actually relevant, while marking
omissions. In this case, you should have left in
Even if Prototype was the culprit, however, that still doesn't answer
the question of why the leak doesn't happen when I add that "href"
attribute to the link.
so that
Yes, it would.
would have made sense to the non-regular reader without having to look up
the precursor (that may not be available anymore then).
Prototype.js uses a lot of closures which create circular
references, many of them unnecessary, which are known to leak memory in IE
if host objects (here: DOM objects) are involved (because its GC can't
handle that), and it does not clean up after itself. Adding the `href'
attribute to the `a' element makes it a link in the first place, so that its
corresponding object shows up in the document.links NodeList, for example.
[Read the FAQ Notes. <http://jibbering.com/faq/faq_notes/closures.html#clMem>
[...] I thought that the memory leak happens when a DOM node
has a circular reference to a JavaScript object. You seem to be saying
that when a link is created, it's added to document.links... wouldn't
that then mean that the link would have *more* references than non-links
and hence be *more* likely to leak, rather than stop leaking? Or is
there something I'm not understanding properly?
Chances are that Prototype.js uses document.links or a similar NodeList in a
closure and adds event listeners with scripting. The uncleaned circular
references to the NodeList or an element of that list would leak memory in
IE. That effect could then only be observed if the event target results in
an element of such a NodeList, i.e. if you make that possible by adding the
`href' attribute.
This is nothing but conjecture, of course. Only a look at the source code
can provide a definitive answer.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
.
- Follow-Ups:
- Re: IE6 memory leak - very fiddly
- From: Daniel Orner
- Re: IE6 memory leak - very fiddly
- References:
- IE6 memory leak - very fiddly
- From: Daniel Orner
- Re: IE6 memory leak - very fiddly
- From: Thomas 'PointedEars' Lahn
- Re: IE6 memory leak - very fiddly
- From: Daniel Orner
- Re: IE6 memory leak - very fiddly
- From: Thomas 'PointedEars' Lahn
- Re: IE6 memory leak - very fiddly
- From: Daniel Orner
- Re: IE6 memory leak - very fiddly
- From: Thomas 'PointedEars' Lahn
- Re: IE6 memory leak - very fiddly
- From: Daniel Orner
- IE6 memory leak - very fiddly
- Prev by Date: Re: Haskell functions for Javascript
- Next by Date: Re: pass function into another function as parameter?
- Previous by thread: Re: IE6 memory leak - very fiddly
- Next by thread: Re: IE6 memory leak - very fiddly
- Index(es):
Relevant Pages
|