Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

AngularJS: Memory Leak with ng-repeat using custom objects (w/simple PLUNKR) #11169

Closed

Description

@momoadeli

(SIMPLE PLUNKR HERE: http://plnkr.co/edit/1Adh2P65ZS8YHYJZhLMk)
(DETAILED STACKOVERFLOW EXPLANATION HERE: http://stackoverflow.com/questions/28683992/angularjs-memory-leak-with-ng-repeat-using-custom-objects-w-simple-plunkr)

SUMMARY:

There is a leak using ng-repeat after the 2nd wave iterating over an array of custom objects like this :

<div ng-repeat="d_sampleObject in mySampleObjects">
    {{d_sampleObject.description}}
</div>

NOTE: 'mySampleObjects' is an array of the following object instances:

    ml.MySampleObject = function (id) {

        this.id = id;
        this.description = 'this is object #:' + ' '+id;
    }

Memory profile reveals an extra 'd_sampleObject' left over and not de-referenced. More details (via a controller and an injected service) in the Stackoverflow link above. A simple demonstration also in the provided plunkr link. Any thoughts and help greatly appreciated in advance!

Activity

  1. added a commit that references this issue on Feb 25, 2015
    31e3b7f
  2. added this to the milestone on Feb 25, 2015
  3. momoadeli commented on Feb 25, 2015

    @momoadeli
    Author

    Reading the latest comments, is it safe to assume that this is indeed a bug in the framework? if so, what timeline should we expect to have a fix? Thanks for your efforts! @Narretz

  4. added a commit that references this issue on Feb 25, 2015
    33e2807
  5. realityking commented on Feb 25, 2015

    @realityking
    Contributor

    I'd see this more of a limitation of the V8 garbage collector than a bug in Angular. It is however a nice little optimisation opportunity. If there are no issues the change will probably be part of 1.3.15.

  6. added a commit that references this issue on Mar 4, 2015
    ca8b0b2
  7. added 2 commits that reference this issue on Mar 9, 2015
    fb7db4a
    528cf09
  8. added a commit that references this issue on Mar 10, 2015
    76f54f6
  9. added a commit that references this issue on Aug 8, 2015
    d04fab3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions