Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of Backbone.Collection in some places is causing memory leaks #1616

Closed
moloko opened this issue Jun 26, 2017 · 1 comment
Closed

Use of Backbone.Collection in some places is causing memory leaks #1616

moloko opened this issue Jun 26, 2017 · 1 comment

Comments

@moloko
Copy link
Contributor

moloko commented Jun 26, 2017

from Ryan Olds:

While tracking down long load times we noticed a lot of stale event listeners related to Backbone.Collections that were not being cleaned up. Backbone.Collection binds event listeners to every model that is added to it. Unless the models are removed or the Collection is reset those event listeners remain on the models, a performance problem (event dispatching) and a memory leak.

To fix this without breaking compatibility with community plugins, we need to create new versions of some of the functions of adaptModel which will return an array instead of a collection, update any core code that uses them and then add deprecation warnings to the existing functions to alert plugin developers that they will need to update any code that uses the old versions.

The functions that need changing are:

  • findDescendants
  • getAvailableChildren
  • getParents
@ryanrolds
Copy link
Contributor

Related PR: #1607

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants