Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Transition] prevent memory leak #21

Closed
aitboudad opened this issue Jan 12, 2017 · 1 comment · Fixed by #120
Closed

[Transition] prevent memory leak #21

aitboudad opened this issue Jan 12, 2017 · 1 comment · Fixed by #120
Labels
Milestone

Comments

@aitboudad
Copy link
Contributor

aitboudad commented Jan 12, 2017

I noticed the memory is growing after each new transition
I did some debugging and I noticed that all created transition not destroyed due to the usage of it's reference in:

selection_049
selection_050

@christopherthielen
Copy link
Member

I appreciate the legwork you're putting in. I'll dig into this before releasing "final"

christopherthielen added a commit to ui-router/core that referenced this issue Jan 21, 2018
The treeChanges object has references to the PathNodes from the previous transition (`.treeChanges("from")`).
The PathNode object has resolve data inside it.
The previous transition is reachable via a resolve (via tokens: `"$transition$"` or `Transition`).
Through this chain, all other transitions are reachable and not eligible for GC.

This change cleans out the previous Transition object from the resolves, but only
after a transition has been evicted from the `successfulTransitions` queue.
The `successfulTransitions` queue currently has a max size of 1, so the transition
is cleaned up once it is no longer the current nor previous transition
(it is cleaned when it's the previous previous transition);

Fixes #55
Fixes angular-ui/ui-router#3603
Fixes ui-router/angular#21
wawyed pushed a commit to wawyed/core that referenced this issue Mar 3, 2018
The treeChanges object has references to the PathNodes from the previous transition (`.treeChanges("from")`).
The PathNode object has resolve data inside it.
The previous transition is reachable via a resolve (via tokens: `"$transition$"` or `Transition`).
Through this chain, all other transitions are reachable and not eligible for GC.

This change cleans out the previous Transition object from the resolves, but only
after a transition has been evicted from the `successfulTransitions` queue.
The `successfulTransitions` queue currently has a max size of 1, so the transition
is cleaned up once it is no longer the current nor previous transition
(it is cleaned when it's the previous previous transition);

Fixes ui-router#55
Fixes angular-ui/ui-router#3603
Fixes ui-router/angular#21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants