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 right after opening IDE #157

Closed
leonhh opened this issue Apr 25, 2024 · 7 comments
Closed

Memory leak right after opening IDE #157

leonhh opened this issue Apr 25, 2024 · 7 comments

Comments

@leonhh
Copy link
Collaborator

leonhh commented Apr 25, 2024

I just tested with beta-8 and it seems like there is some sort of memory leak with my project. When I use a newly created project this does not happen. It happens immediately when opening the IDE. It does seem to create a simulator but it keeps hanging on the build step and it consumes all available memory.

2024-04-25 14:20:58.825 [info] Command dd if=/Users/leon/.vscode/extensions/swmansion.react-native-ide-0.0.8-beta/dist/sim-server of=/var/folders/8_/lq0wpp5n3c59g_fhjhhptqvw0000gn/T/sim-server produced error output: 36147+1 records in
36147+1 records out
18507680 bytes transferred in 0.087868 secs (210630491 bytes/sec)
2024-04-25 14:20:58.969 [info] Found app root folder: /Users/leon/workspace/app
2024-04-25 14:21:08.785 [info] Setup dependency checker listeners.
2024-04-25 14:21:08.785 [info] Setup dependency installer listeners.
2024-04-25 14:21:08.785 [info] Launching devtools
2024-04-25 14:21:08.785 [info] Launching metro
2024-04-25 14:21:08.794 [info] Devtools started on port 52482
2024-04-25 14:21:08.927 [info] Received checkNodejsInstalled command.
2024-04-25 14:21:08.928 [info] Received checkAndroidEmulatorInstalled command.
2024-04-25 14:21:08.928 [info] Android Emulator installed:  true
2024-04-25 14:21:08.938 [info] Received checkXcodeInstalled command.
2024-04-25 14:21:08.944 [info] Received checkCocoaPodsInstalled command.
2024-04-25 14:21:08.944 [info] Received checkPodsInstalled command.
2024-04-25 14:21:08.945 [info] Check pods in /Users/leon/workspace/app/ios /Users/leon/workspace/app
2024-04-25 14:21:08.945 [info] Project pods installed:  true
2024-04-25 14:21:08.972 [info] Nodejs installed:  true
2024-04-25 14:21:09.345 [info] Selected device is ready
2024-04-25 14:21:09.397 [info] Xcode Command Line Tools installed:  true
2024-04-25 14:21:09.894 [info] Metro Starting project at /Users/leon/workspace/app
2024-04-25 14:21:09.903 [info] Metro env: load .env.local .env
2024-04-25 14:21:09.903 [info] Metro env: export EXPO_PUBLIC_ENVIRONMENT EXPO_PUBLIC_WEBSITE_DOMAIN EXPO_PUBLIC_DOMAIN EXPO_PUBLIC_API_URL EXPO_PUBLIC_ACCOUNT_URL EXPO_PUBLIC_CLIENT_ID EXPO_PUBLIC_CLIENT_APPLICATION_ID
2024-04-25 14:21:13.352 [info] Metro {"hasReducedPerformance":false,"port":0,"type":"initialize_started"}
2024-04-25 14:21:13.352 [info] Metro {"type":"dep_graph_loading","hasReducedPerformance":false}
2024-04-25 14:21:13.374 [info] Metro {"type":"RNIDE_initialize_done","port":52511}
2024-04-25 14:21:13.375 [info] Metro started on port 52511
2024-04-25 14:21:13.414 [info] Metro & devtools ready
2024-04-25 14:21:21.457 [info] CocoaPods installed:  true
2024-04-25 14:21:44.360 [info] Metro Waiting on http://localhost:8081
2024-04-25 14:21:44.366 [info] Metro Logs for your project will appear below.
2024-04-25 14:21:44.367 [info] Metro {"type":"dep_graph_loaded"}
2024-04-25 14:21:44.371 [info] Metro {"type":"transformer_load_started"}
2024-04-25 14:21:48.333 [info] Metro {"type":"transformer_load_done"}
2024-04-25 14:21:48.334 [info] Metro {"type":"initialize_done","port":0}

Screenshot 2024-04-25 at 14 23 27

npx react-native config output

app.config.ts

@kmagiera
Copy link
Member

thanks for reporting. Is the provided list of hanging processes a result of you trying it multiple times, or it spawns processes like that with a single run. Also when you shut down VSCode do these processes stay active?

@leonhh
Copy link
Collaborator Author

leonhh commented Apr 26, 2024

Hi @kmagiera thanks for looking into it. So far RN IDE seems really promising!

The provided list of processes is the result of clicking "Open IDE Panel". So that would be a single run. After dismissing the IDE panel the processes will keep spawning. After closing VSCode the processes will stop spawning and they will automatically stop again.

This is after closing VSCode:
Screenshot 2024-04-26 at 14 13 50

Video recording of what happens

@kmagiera
Copy link
Member

Would you be able to double click on any of these in activity monitor to see what's the parent process? The IDE doesn't launch react-native CLI commands at all, so this must be spawned by some other commands that we run

@kmagiera
Copy link
Member

I checked on what could be spawning these commands, and it appears like this could be pod install process which handles outolinking. Have you maybe used the IDE to install Pods (there is a "fix" button in the diagnostics panel for that)

@leonhh
Copy link
Collaborator Author

leonhh commented Apr 26, 2024

No, I have not used the IDE to install pods. I already ran expo prebuild before starting the IDE. Pods are already installed. This issue also happens when all other plugins are disabled.

Screenshot 2024-04-26 at 15 23 47

I just cloned the repo and will also try to dig a little deeper myself.

@leonhh
Copy link
Collaborator Author

leonhh commented Apr 29, 2024

Closing this for now as it seems to work fine in other projects and I could not reproduce it in a clean project.

@leonhh leonhh closed this as completed Apr 29, 2024
@FaithfulAudio
Copy link
Collaborator

FaithfulAudio commented Dec 23, 2024

@kmagiera @leonhh Hello Sir! I've been using the IDE, by the way, amazing.

However I'm seeing something quite similar still. After using it several times, I have to go to activity manager and kill tons of node processes that seem to spawn as a result of using it. This gets to a point where every start up it overloads memory if I don't do this.

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

3 participants