Closed attrobit closed 6 years ago
Similar issue: https://github.com/ui-router/angular/issues/21
Please try your experiment again, but this time click the "collect garbage" button before stopping the profiler (it is the small trash can icon next to the "Memory" checkbox in your screenshot). My tests show that memory use is not increasing significantly.
Applications (and therefore, ui-router) do not have any control over triggering garbage collection. It's done completely at the javascript runtime's discretion.
See this comment for more details on reporting memory leak bugs: https://github.com/angular-ui/ui-router/issues/545#issuecomment-277092153
Thanks for your reply.
I looked more in Detail by doing a memory heap dump. When i do a heap dump via memory -> take heap snapshot, chrome do a garbage collection before. I did a heap snapshot on hello state, about state and again hello state. The number of memory increase constantly. And i recognized that for every state change a new "Transition"-Object retains in the heap. See the following screenshots.
Hello State:
About state:
Hello State:
for clarity, did you force a garbage collection between each heap dump?
Edit: I tried it myself and see that Transitions are indeed being retained. Thanks for the analysis
This is an issue in uirouter/core. Follow this related issue: https://github.com/ui-router/core/issues/55
The leak still exist. Testet with Version 1.0.14 (example)
JS-Heap over time (Switched multiple times between hello and about state):
The number of Transition-Objects still increases. See the foolowing heap-dump.
This is a (check one box):
My version of UI-Router is: (type version) 1.0.12, but the problem also exists in version 1.0.5
Bug Report
Current Behavior:
When switching between states, the JS-Heap increase and get not garbage collected. See the following screenshot.
For the example above i used the uirouter example in plunker.
As i analyzed the heap in detail i saw that the number of Transition-Objects increase with time.
Expected Behavior:
The JS-Heap get garbage collected after switching back to previous state.
Link to Plunker or stackblitz that reproduces the issue:
You can reproduce the problem with the uirouter example app in plunker: example
Just switch multiple times between the state "hello" and "about".