Open
Description
Description
Facing Memory Leak with React Native app integrated with existing native app.
I am currently on React Native 0.71.1 and tried to update to React Native 0.74.2.After upgrade facing memory leak. Memory usage keeps on increasing. With version 0.72 also there is no leak faced. But from version 0.73 facing memory leak.
Following this react native callstack brownfield architecture to load react native inside existing app as we have multiple entry points from native app to load react native in Fragment and also in Activity.
Steps to reproduce
- Clone the repo -
https://github.com/callstack/react-native-brownfield
- Do
yarn install
- Try to open the example kotlin app
- Open profiler from android studio
- Perform Action like Click on Open React Native Button
- Capture the Heapdump
React Native Version
0.74.2
Affected Platforms
Runtime - Android
Output of npx react-native info
System:
OS: macOS 14.5
CPU: (10) arm64 Apple M1 Pro
Memory: 125.97 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.20.1
path: ~/.nvm/versions/node/v18.20.1/bin/node
Yarn:
version: 1.22.22
path: ~/.nvm/versions/node/v18.20.1/bin/yarn
npm:
version: 10.5.0
path: ~/.nvm/versions/node/v18.20.1/bin/npm
Watchman:
version: 2024.05.06.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.5
- iOS 17.5
- macOS 14.5
- tvOS 17.5
- visionOS 1.2
- watchOS 10.5
Android SDK: Not Found
IDEs:
Android Studio: 2024.1 AI-241.15989.150.2411.11948838
Xcode:
version: 15.4/15F31d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /Users/satheshrangasamy/.jenv/shims/javac
Ruby:
version: 2.7.4
path: /Users/satheshrangasamy/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.74.2
wanted: 0.74.2
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
Stacktrace or Logs
Attached Memory Leak Profiler ScreenShot
Reproducer
https://github.com/satheshrgs-rksv/memoryleakreproducer