DevTools Tips

Get detached DOM elements to investigate memory leaks

Categories: Supported by:

Memory leaks can quickly become a big problem for long-running applications, and a common source of memory leaks is detached DOM elements (elements that are no longer attached to the DOM tree). It's usually very hard to investigate these memory leaks, because it's hard to know if elements are detached, and which ones, let alone find which part of your JavaScript code is causing them to be detached.

Edge has a tool just for this: the Detached Elements panel. To use it:

You can find out much more about this tool in this blog post and over at Microsoft's documentation site.

Screenshot of the Detached Elements panel in Edge, with the Memory panel next to it