-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
[WIP] Fix for fiber root scheduling memory leak #11644
Conversation
!isWorking && | ||
root === nextRoot && | ||
expirationTime < nextRenderExpirationTime | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea what my brain was thinking then. Sorry, pushed the code.
I don't have enough context on which variables should be reset when but my hunch is that they don't all need to be reset twice. Let's leave this to @acdlite. |
Thanks for tracking this down. I think I have a better idea for how to fix it. What's the best way to reproduce the error, and confirm that it's fixed? |
@acdlite I used |
We'll come back to this with a more concrete implementation from @acdlite later. Merging so that 16.2 doesn't ship with memory leak. |
Thx for the fix. My React Native App needs now less memory. Just wanted to let some real world data here:
|
Not to be merged
After some investigation work for a memory leak on React Native, we found that
nextRoot
was never set tonull
and left in that state upon the view fulling being unmounted. I believe that is has to do with the fact that we setnextRoot
andnextUnitOfWork
tonull
, then immediately callrequestWork()
which sets them back again.This results in a memory leak as the node tree of
nextRoot
never gets garbage collected.This is more of a temporary research fix, rather than an explicit fix. I'm sure @acdlite will have a concrete fix based from this.