Dom Element Memory Leak Sample
- Open the chrome Dev tools (F12)
- Go to the "Profiles" tab
- Select "Take Heap Snapshot"
- Open the console and type "runLeak()"
- Click "Start" to generate a profile
- Note the "Detached DOM Tree" - elements that are referenced and therefore not garbage collected
- Open the console and type "removeLeak()"
- Take another snapshot by clicking "Start"
- Note that the "Detached DOM Tree"s have been garbage collected