C
C
crazyjs2015-04-11 21:05:43
JavaScript
crazyjs, 2015-04-11 21:05:43

AngularJS memory leak?

I created a small admin panel in angularJS using ng-view and a few custom directives. + Angular Materials
as a result using the technique of three snapshots - I have (made 100 transitions between windows using ngRoute )

First snapshot - 9.9 mb
Second snapshot - 26.8 mb
First snapshot - 41 mb

Comparing these snapshots, I saw that many directives remained in memory, as well as a very large closure and array (according to the snapshop table)

I tried to delete elements after the scope was destroyed - nothing has changed.
How to fix something like this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Osher, 2015-04-11
@miraage

I am 99% sure that you made a mistake when you wrote the code. They leaked themselves.
Please share the code if I'm wrong.

A
Alexander, 2015-04-16
@istem

Leaks from Angular were seen in IE<=9. Didn't overcome. But caching delayed the end a bit. In principle, you can look in the direction of closures and declarations of anonymous functions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question