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 on iOS #420
Comments
I can confirm issue also exists when using the useNetInfo hook
|
Have this problem too. |
…ck to apply iOS only.
This reverts commit f548313.
I am also seeing this as of version 6.0.0 |
Anyone have a PR to fix it? That would help |
I'm not sure I'm reading this correctly, but: ios/RNCNetInfo.m - (instancetype)init
{
self = [super init];
if (self) {
_connectionStateWatcher = [[RNCConnectionStateWatcher alloc] initWithDelegate:self];
}
return self;
} That's the only place the identifier Could the following, just below that, be a mistaken attempt to tear it down ( - (void)dealloc
{
self.connectionStateWatcher = nil;
} |
The problem might crash an app. I'll try to use NetInfo.fetch() in interval, hope that will help |
Nope, looks like leaks are still there and these frequent checks are not good for performance |
Auto release is all set up. Anyone with a PR can have a release almost immediately |
Any updates on this? |
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 ? 🙏 |
`CNCopyCurrentNetworkInfo` will leak without location permissions being enabled.
@mikehardy finally got some time to look into this and it is noted in the README, but still sets folks up for failure as most RN devs would expect more setup steps for native code or for it to be built into the library. That being the link here to the Discussion section of the deprecated CNCopyCurrentNetworkInfo. I was about to put in a PR but not sure if it's appropriate as What would be your advice on how to proceed or can you tag someone that can help out? I/someone could:
|
I didn't directly say this, but I profiled with and with out the above code and could directly see an effect on the memory leak on my own app, but had no issues on the example for some reason. |
@matt-oakes ☝️? With the pettiness shown here I am trying to make sure I'm not being ignored seeing as responses otherwise came within a day. I have time to work on this but need direction, otherwise the potential for this open source contribution that @mikehardy is very adamant about, will devolve into just a patch for my own project. |
Not sure about pettiness, I do my best to just state facts and I'm sorry if you feel my response is petty - not the intention, with regard to ignored, I've simply been really really busy and haven't had time. I've got this one queued though, a memory leak if demonstrated is a really big deal and I'd love to integrate any solution you've found |
This response is taking longer because it now contains real work which requires real work to process 😅 - however, with the real work you've done I think it contains all the information required for anyone to verify it, which is a force multiplier in open source, whereas the initial fuzz-busting of "this doesn't have the info" is something I try to do really quickly just to make sure issues / reports meet minimum standards |
The leak was demonstrated by the initial writeup. You can see that
Do you have any input for the above writeup? I can just put in the PR & let it ride there if that'd be more useful. Clearly the library is not following the requirements for
Apologies, with the speed and attitude of other replies I thought of the eventuality that you were simply going "ugh... just put in a PR, why are you commenting 🙄" or something of the like. Facts & how they are presented are not without meaning to others despite your intentions and I only have that to judge you from. |
All fair, my presentation is certainly brief The absence of a PR means that work needs to be done and it all just takes time unfortunately |
`CNCopyCurrentNetworkInfo` will leak without location permissions being enabled.
🎉 This issue has been resolved in version 7.1.12 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Following up on the closed issue #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
Environment
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
The text was updated successfully, but these errors were encountered: