react-native-netinfo: Memory leak on iOS
Following up on the closed issue https://github.com/react-native-community/react-native-netinfo/issues/325
This does seem to be an issue with memory leaks, which occur on app start.
Simple reproduction is init a new RN app ad add
React.useEffect(() => {
const unsubscribe = NetInfo.addEventListener(() => {});
return () => unsubscribe();
}, []);
Environment
System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Memory: 1.20 GB / 32.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.2 - ~/.nvm/versions/node/v12.16.2/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v12.16.2/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /Users/oliverwinter/.rvm/gems/ruby-2.6.1/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_242 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Platforms
Memory leaks were found in iOS on device iPhone 11 pro 14.0.1
Versions
“@react-native-community/netinfo”: “5.9.7”,
Description
Reproducible Demo
add effect in new app and profile on device to see leaks on app start
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 9
- Comments: 18 (10 by maintainers)
Commits related to this issue
- #420 Bugfix — committed to SukhKalsi/react-native-netinfo by PyGuy2 3 years ago
- #420 Bugfix - match Android API accordingly due to the iOS fix. — committed to SukhKalsi/react-native-netinfo by PyGuy2 3 years ago
- #420 Bugfix - Add nullable check. — committed to SukhKalsi/react-native-netinfo by PyGuy2 3 years ago
- #420 Bugfix - revert android and use platform check to apply iOS only. — committed to SukhKalsi/react-native-netinfo by PyGuy2 3 years ago
- #420 RNCNetInfo interface updated — committed to DominikSecka/react-native-netinfo by DominikSecka 3 years ago
- #420 pinned versions + fresh lock file — committed to EconomistDigitalSolutions/react-native-netinfo by DominikSecka 3 years ago
- #420 removed prepare script — committed to EconomistDigitalSolutions/react-native-netinfo by DominikSecka 3 years ago
- Revert "#420 removed prepare script" This reverts commit f5483135943b1aabc48929bf33dcc366c04826c8. — committed to EconomistDigitalSolutions/react-native-netinfo by DominikSecka 3 years ago
- Fix #420 - Location Permissions Required `CNCopyCurrentNetworkInfo` will leak without location permissions being enabled. — committed to alburdette619/react-native-netinfo by deleted user 2 years ago
- Fix #420 - Location Permissions Required `CNCopyCurrentNetworkInfo` will leak without location permissions being enabled. — committed to alburdette619/react-native-netinfo by deleted user 2 years ago
- chore(release): 7.1.12 [skip ci] ## [7.1.12](https://github.com/react-native-netinfo/react-native-netinfo/compare/v7.1.11...v7.1.12) (2022-02-09) ### Bug Fixes * **ios:** avoid memory leak from ssi... — committed to react-native-netinfo/react-native-netinfo by semantic-release-bot 2 years ago
I can confirm issue also exists when using the useNetInfo hook
The beauty of open source is that if there are updates everyone can see them immediately. There’s no secret updates. Anyone that wants to tackle this may feel free @hypothete ? 🙏
Auto release is all set up. Anyone with a PR can have a release almost immediately