-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Debugging projects using too much RAM #25698
Comments
UPDATE As I said above, using After that, I tried running |
UPDATE 2 WITH WORKAROUND Returning to Sadly I had to remake the project using |
Have you tried RN 0.60.3 with node 12.4? It seems that something in metro bundler triggers a memory leak in node 12.6. |
Wow, you are right! Using node v12.4 solved the issue, even with RN 0.60.3! I should have thought about using previous node versions, but whatever. So we have 2 workarounds as of now: either downgrade RN or use node 12.4. Anyways, thank you! |
Thanks, @plouh you saved my day! |
So I am having many, MANY issues with react-native lately, I'll give my best to describe what is happening here, so please correct me if I do something wrong or if you need more information.
Disclaimer: This seems related to the metro bundler, but since this is happening on all RN-related projects I've opened the issue here. If needed I can move this issue elsewhere.
So what happened is that debugging RN projects started consuming too much RAM, so much in fact that it frequently freezes my PC.
It started on a simple project I've created with
react-native init
. After that I've installed and configured some dev dependencies (babel, eslint, prettier, typescript) and started the bundler withreact-native start
, but then bundler got stuck inLoading dependency graph...
and kept ramping up RAM consumption until my computer eventually froze.I thought that it was maybe some bad configuration that I made, so I stashed my changes and returned to the default structure that comes with
react-native init
, and it still bugged out, but this time, there was a difference: The bundler showedLoading dependency graph... Done
but still kept ramping up RAM consumptionI tried starting another fresh new project and start the bundler there, but the issue persisted on every new project started with
react-native init
. The thing is: there is another difference here too! If I stop the bundler before my computer freezes and start it again, the issue stopsI tried running
watchman watch-del-all
and starting the bundler withreact-native start --reset-cache
but it was all for naught, the issue persists.Also keep in mind that not even once I got to actually run my project on a device or emulator, my computer freezes before it even gets to build.
Environment
React Native version:
System:
OS: Linux 4.15 Linux Mint 19.1 (Tessa)
CPU: (4) x64 Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
Memory: 1.97 GB / 7.71 GB
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 12.6.0 - ~/.nvm/versions/node/v12.6.0/bin/node
Yarn: 1.16.0 - ~/.nvm/versions/node/v12.6.0/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v12.6.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.3 => 0.60.3
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1
react-native: 0.60.3
Steps To Reproduce
react-native init myproject
cd myproject
react-native start
Describe what you expected to happen:
Well, maybe actually get to work on a RN project in peace.
Snack, code example, or link to a repository:
The project I'm working on is private and the issue can be reproduced with only
react-native-cli
it seems, but if needed I can open a dummy repo with all the configuration files and dependencies I'm using.The text was updated successfully, but these errors were encountered: