# A memory leak can occur in your application when an element is no longer attached to the Document Object Model (DOM) tree, but is still referenced by some JavaScript running on the page. These elements are called detached elements.
 a reference to an object will prevent the object referenced from being garbage collected.
 # window leaks
 variables set on the window do not get collected
 - windwo.myvar = 'whatever'
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter