angular-ui / ui-scroll

Unlimited bidirectional scrolling over a limited element buffer for AngularJS applications
http://angular-ui.github.io/ui-scroll/demo/
MIT License
327 stars 107 forks source link

Memory issues #199

Closed tosman closed 6 years ago

tosman commented 6 years ago

Has anyone run into memory leaks with this component. Seems like it's leaking quite a bit for me.

Shouldn't this do a buffer.reset() in the onDestroy()

https://github.com/angular-ui/ui-scroll/blob/master/src/ui-scroll.js#L208

dhilt commented 6 years ago

@tosman My last experience with memory leaks was more than 1 year ago. And no potential dangerous entities were added to the library since that time. By the way I've run my shallow memory tests (based on this demo) and found no leaks. Do you have repro?

Regarding buffer.reset(), 2 things that could be interested here are buffer element's scope destroying and removing buffer element from DOM. I believe, child scopes are being disposed automatically during parent's scope destroying. Also, I can't imagine situation when ui-scroll is destroyed while buffer items are still in DOM. So, a repro is needed to continue this story!

dhilt commented 6 years ago

Closed due to inactivity.