3 ms·
A "garbage collection leak" is a leak if you have a reference to an object that you don't really need anymore. Consider a Document Object Model tree with 20 MB
by MichaelCrawford 11y ago
A "garbage collection leak" is a leak if you have a reference to an object that you don't really need anymore.
Consider a Document Object Model tree with 20 MB of memory. Each child holds a reference to its parent. If there are no references from outside the tree to anywhere inside it, it will eventually be collected. But one single reference to a DOM node from anywhere outside the DOM, and you've leaked twenty meg.