Because I had a hard time finding the cause of a memory leak, I ended up making this bookmarlet to help find evidence of a memory leak caused by event listener not being removed on a webpage.
Once this bookmarklet is activated on your webpage, you will be able to call the getEventListenersStats()
from the Chrome DevTools Console. This function will give you stats about all events listeners and handlers.
Follow the instruction on http://htmlpreview.github.io/?https://gist.githubusercontent.com/thomasleveil/c280d8a6f77682a2d15c11e0e11846a8/raw/install.html
- run
getEventListenersStats()
- do some action you suspect will leave event listeners behind
- run
getEventListenersStats()
- compare the stats