Dom Element Memory Leak Sample

  1. Open the chrome Dev tools (F12)
  2. Go to the "Profiles" tab
  3. Select "Take Heap Snapshot"
  4. Open the console and type "runLeak()"
  5. Click "Start" to generate a profile
  6. Note the "Detached DOM Tree" - elements that are referenced and therefore not garbage collected
  7. Open the console and type "removeLeak()"
  8. Take another snapshot by clicking "Start"
  9. Note that the "Detached DOM Tree"s have been garbage collected