Let me preface this by saying that I do not work at Google, nor am I a
person who contributes code to the Angular project. Should any of those
people have a differing opinion or better information, I would be very
willing to listen.
That being said, we were having a similar problem at my company. Browser
tabs left open for an extended period (days) and subject to mild use were
consuming around a gig of memory. After some intensive study, we concluded
that our problem was two-fold.
First, we were not utilizing $scope.$on('destroy') in our directives to
remove or release bindings to elements. Even if you remove an element from
the DOM, the binding can still hang on in memory, and it now has no way to
be cleared save close the browser. By going through each of our directives
and adding this one event we were able to knock the size down a small
amount, but there were still things hogging up the memory.
After a lot more digging, we found that the vast majority of what was
taking up memory in the browser was jQuery. Memory leaks in jQuery are very
well documented and suprisingly very accepted as "that's just the way it
is." Some get fixed, but others do not. For this reason, our company policy
is now to recommend that our customers close and re-open the browser at
least once per day to free up memory.
I know these aren't the best solutions to memory problems, but they work
for us. Your mileage may vary.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.