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

Simple app causing a memory leak? #4037

Closed
kaycebasques opened this issue Feb 16, 2018 · 2 comments
Closed

Simple app causing a memory leak? #4037

kaycebasques opened this issue Feb 16, 2018 · 2 comments

Comments

@kaycebasques
Copy link

Is this a bug report?

I think so!

I was monitoring the Chrome DevTools Stack Overflow channel, and somebody asked for help as to why the listeners were increasing in this sample app they created: https://stackoverflow.com/q/48201104/1669860

Did you try recovering your dependencies?

I'm building via Glitch and repro'd locally, so this is unlikely.

Which terms did you search for in User Guide?

Sorry, don't have time to do this.

Environment

https://glitch.com/edit/#!/aback-dedication

Steps to Reproduce

  1. Go to https://aback-dedication.glitch.me
  2. Start a runtime perf recording in Chrome DevTools.
  3. Force GC at 10s and 30s.
  4. Stop recording after 60s.

Expected Behavior

Memory does not keep increasing. Listeners do not keep increasing.

Actual Behavior

screen shot 2018-02-16 at 3 06 48 pm

Reproducible Demo

Demo:

https://aback-dedication.glitch.me

You can inspect the code at:

https://glitch.com/edit/#!/aback-dedication?path=src/App.js:24:12

Everything is default from the boilerplate create-react-app sample except for App.js.

@kaycebasques
Copy link
Author

Actually, I didn't check the Glitch live demo that closely. When I force GC, it looks like memory drops back down to baseline. I'd still appreciate a second pair of eyes to see if anything fishy is going on!

@gaearon
Copy link
Contributor

gaearon commented Feb 18, 2018

Fairly sure this isn't a memory leak but just excessive listener creation. It only happens in development builds, not in production. You can see these thread for more details: facebook/react#10576 and facebook/react#12141. We do create listeners but we expect GC to clean them up.

If you can reproduce a leak, let me know.

@gaearon gaearon closed this as completed Feb 18, 2018
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants