Detached Windows Demo

Take a heap snapshot to open a popup windowwin = window.open(..) Take a heap snapshot (in DevTools' Memory tab → Take Snapshot) to navigate the popup to a heavy documentwin.location = '..' Take a heap snapshot Now close the popup (manually) Take a heap snapshot.

Notice it still includes the heavy document as a DetachedWindow.

open a popup window to unset our reference to the popup:win = null Take a heap snapshot.

Notice the heavy document and DetachedWindow are now gone.

That's it!