Memory leak on iOS
See original GitHub issueFollowing 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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:18 (10 by maintainers)
Top Results From Across the Web
What Are iOS Memory Leaks and How to Detect Them?
A memory leak is a piece of memory that was allocated at one point but never released, and is also no longer referenced...
Read more >Everything you need to know about Memory Leaks in iOS
A memory leak occurs when a given memory space cannot be recovered by the ARC (Automatic Reference Count) because it is unable to...
Read more >Detecting Memory Leaks in iOS - Dev Genius
Basically, a memory leak is when an object that should have been released from memory did not get deinitialized and it's still lingering...
Read more >How to detect iOS memory leaks and retain cycles using ...
A memory leak in iOS is when an amount of allocated space in memory cannot be deallocated due to retain cycles. Since Swift...
Read more >Making changes to reduce memory use
Eliminate memory leaks ... A memory leak occurs when allocated memory becomes unreachable and the app can't deallocate it. Allowing an allocated-memory pointer...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 ? 🙏