You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to a questionable feature in jQuery, the resize code causes a memory leak where it will hold on to every DOM node it has ever tracked. In a single-page application this can be a serious issue if you're creating and destroying things around the place.
jQuery has a strange feature where it keeps references to every state in a series of jQuery method calls, in a property called prevObject. If you keep jQuery references around for a while and do lots of stuff, they can amass a huge chain of prevObject references, preventing anything from being garbage collected. More information: http://blog.cowchimp.com/jquery-prevobject-memory-leak/
This resize library stores its tracked elements in a jQuery array (var elems = $([])), which is never disposed. It then uses mutating functions to add and remove elements. Unfortunately, due to the above jQuery feature, this means that any element that ever enters that elems collection will be retained indefinitely.
The solution is to replace the elems jQuery array with a normal Javascript array.
The text was updated successfully, but these errors were encountered:
Due to a questionable feature in jQuery, the resize code causes a memory leak where it will hold on to every DOM node it has ever tracked. In a single-page application this can be a serious issue if you're creating and destroying things around the place.
jQuery has a strange feature where it keeps references to every state in a series of jQuery method calls, in a property called
prevObject
. If you keep jQuery references around for a while and do lots of stuff, they can amass a huge chain ofprevObject
references, preventing anything from being garbage collected. More information: http://blog.cowchimp.com/jquery-prevobject-memory-leak/This resize library stores its tracked elements in a jQuery array (
var elems = $([])
), which is never disposed. It then uses mutating functions to add and remove elements. Unfortunately, due to the above jQuery feature, this means that any element that ever enters thatelems
collection will be retained indefinitely.The solution is to replace the
elems
jQuery array with a normal Javascript array.The text was updated successfully, but these errors were encountered: