Skip to content

Instantly share code, notes, and snippets.

@meleyal
Last active December 17, 2015 10:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meleyal/5598689 to your computer and use it in GitHub Desktop.
Save meleyal/5598689 to your computer and use it in GitHub Desktop.
Tools for debugging memory leaks
# Get all the jQuery bound events on an element:
console.log $._data(el, 'events')
# Create and remove multiple instances of a view:
window.installTest = ->
views = []
viewClass = MyView
options = {}
views.push(new viewClass(options)) for i in [0...500]
view.remove() for view in views
views = []
console.log "#{viewClass.name} installed and removed x #{i}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment