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

Memory Leak When Using Synchronous Loading With Async Components #9229

Closed
adrienbaron opened this issue Dec 19, 2018 · 4 comments
Closed

Memory Leak When Using Synchronous Loading With Async Components #9229

adrienbaron opened this issue Dec 19, 2018 · 4 comments

Comments

@adrienbaron
Copy link
Contributor

Version

2.5.21

Reproduction link

https://codesandbox.io/s/xlly27wy8z

Steps to reproduce

Same as: #8740

  • Load the reproduction link in Chrome
  • Open Chrome Dev Tools
  • Go to the memory tab
  • Click on the "Destroy" button
  • Take a "Heap Snapshot"
  • Filter to look for "Detached HTMLDivElement"
  • You should see 2 leaking HTMLDivElement

What is expected?

Context for loading the Async component should be cleared.

What is actually happening?

There are 2 components still attached to a context of an Async loading Component.
It is not cleared if the Async component is loaded synchronously.


This is the same issue as #8740. However the fix for it only fixes the case when loading is actually async. Synchronous async loading does not call the "forceRender" (2e472c5#diff-293f31f6a318619ad803b971ef0724a3R64) so the contexts array is not cleared.
I can try to fix it and submit a PR if needed.

@adrienbaron
Copy link
Contributor Author

Hi! No news on this issue, is it fine if I try to do a PR for it? :)

@posva
Copy link
Member

posva commented Jan 2, 2019

Hey, sorry for the delay. I haven't checked the repro yet but if you already know about the fix, yes, feel free to submit the PR and thank you! 🙂

@adrienbaron
Copy link
Contributor Author

adrienbaron commented Jan 2, 2019

No problem it's the holidays ^^. I'll see to do that this afternoon!

@adrienbaron
Copy link
Contributor Author

@posva PR submitted 👍 : #9275

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants