The Basics
-
Fail Original Leak Test Case
- Baseline - Create and remove 10000 FORM tags (creates 10000 orphaned FORM nodes)
- Screen Shot of sIEve in this example
-
Fail Control Test Case
- Baseline Test but using a DIV rather than a FORM tag
-
-
Fail b.removeNode(true);
- Using removeNode(true) rather than removeChild
-
Fail Control b.removeNode(true);
- Control using removeNode(true) rather than removeChild
-
Fail b.removeNode(false);
- Using removeNode(false) rather than removeChild
-
Fail Control b.removeNode(false);
- Control using removeNode(false) rather than removeChild
-
Fail Garbage Collection - parentNode.innerHTML = '';
- Using the usual Garbage Collection technique of adding the node to be removed to another node and then setting it's innerHTML to nothing
- Screen Shot of sIEve with Failure for FORM tag.
-
Success Control Garbage Collection - parentNode.innerHTML = '';
- Control using the usual Garbage Collection technique of adding the node to be removed to another node and then setting it's innerHTML to nothing.
- Screen Shot of sIEve with Success for Control
-
Fail Doing removeChild() and then removeNode
- Suggestion from the Ajaxian thread, doesn't seem to fix the issue.
- Screen Shot of sIEve with Failure.
-
Fail Doing removeChild() and then removeNode pt.2
- Suggestion from the Ajaxian thread, doesn't seem to fix the issue.
- Screen Shot of sIEve with Failure.
Getting Creative (aka grasping at straws)
-
Fail b.replaceNode(z)
- My rational: "maybe removing an actual form is the issue, so how about we make the form node something else and then remove it"
-
Fail AutoComplete = 'OFF'
- My rational: "maybe it's the autocomplete feature that's built into IE since IE5"
-
Fail HasLayout?
- My rational: "It's late, why not, what harm could it do, lets try setting the HasLayout to true and see what that does"
-
Fail Douglas Crockfords - Purge() function
- Lots of mentions online as the cure for all, dosn't work here
-
Fail use CollectGarbage() function that's in JScript'
- Worth a try, I just don't think it thinks there is any garbage to collect.
-
Success AW create your own Garbage Collection
- AW just posted a snippet on the blog post, that seems in this test setup.. create one then delete this should leave you with none, and it appears to work.
How Libraries Fair
- Dojo 0.4.3 dojo.dom.destroyNode()
- Currently 'leaks' on form nodes
- Dojo 0.9.0 dojo._destroyElement()
- Currently 'leaks' on form nodes
- Base, jQuery, Mochikit, MooTools, Prototype, Sciptaculous, YUI, Ext
- None of these toolkits seem to even have any approaches to handling IE6 DOM leaks (or orphaned nodes), so I guess that's a plus point to Dojo that they at least tried. If I looked in the wrong place, just let me know and I'll add a test of that toolkits approach.
Other Findings
- The parent of the orphan is a document_fragment
- Not sure if this is normal, but drilling down in sIEve into the left over orphaned form nodes, their parentNode object is a document fragment (nodeType: 11), I couldn't find any information about how to access document fragments once they are fragmented, but that might be an option, if it's possible.
- Screen Shot of sIEve with the orphans Parent Object info