Memory Leak with latest React Native Integrated App on v0.74.2
まだ誰も着手していません。
- 主要言語
- C++
- スター
- 127k
- フォーク
- 25.3k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 4
説明
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
Screenshots and Videos
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされた memoryleakreproducer から始めます。yarn install を実行し、Kotlin のサンプルアプリを開いて、React Native の操作を繰り返しながら Android Studio の profiler を使用します。React Native 0.72、0.73、0.74.2 でメモリの挙動を比較します。完了の条件は、リグレッションが切り分けられ、reproducer で profiler に無制限の増加が表示されなくなることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, kotlin, react-native
- 領域
- mobile, performance
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100