Skip to content

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

Description

@moloko

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions