Skip to content

Debugging projects using too much RAM #25698

Closed
@josecarlosns

Description

@josecarlosns

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 with react-native start, but then bundler got stuck in Loading 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 showed Loading dependency graph... Done but still kept ramping up RAM consumption

I 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 stops

I tried running watchman watch-del-all and starting the bundler with react-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

  1. react-native init myproject
  2. cd myproject
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions