-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Big memory and cpu leak on android #2027
Comments
That's an interesting case. Any ideas how to localize the leak? |
A potential avenue to explore would be nesting your MapView inside a screen accessible through the DrawerNavigator for android. This forces you to re-render the MapView when you return to the screen holding that view. I will give it a shot here in a little bit and post some code for you if I come up with a solution. |
I'd be happy to sponsor anyone who can come up with a solution this week. It's urgent :( |
@v3solutions |
@DanGDroid |
@v3solutions Which navigator did you used for that two components containing the MapView? |
@wjielim Sorry for a delay. Even using simple if statements (to switch components containing MapView ) adds memory and cpu to it. |
@v3solutions can you test the #2197 PR to see if it fixes this case? Thanks 🤗 |
@khsily I've seen issues where memory leaks are caused by console.log(...) statements on iOS |
@MarkOSullivan94 thank you for the console.log() tip! You saved my day. It is a problem on android.
It was a no issue with older react native version (0.44) |
[EDIT] Ok my problem was related to markers and I solved it setting the markers to tracksViewChanges to false! The strange thing is actually that it's surely a leak issue considering that, as the author of the issue stated too, this happens (to me too) when mounting and unmounting the component or even when reloading while developing (as I stated in my comment) [EDIT] My god... finally, this is it! I've been having my whole app slow while developing and I do understand why now!! I understand that not every app has a map inside, but this issue is so serious that should be a number 1 priority. What can we do? There have been done some steps forward? I'd be really happy to help somehow |
closing, old issue :) |
still happening on 0.27.1 |
Is this a bug report?
Memory and cpu leak on android using any navigation (react native navigation, react navigation, even simple if switching pages). Seems like a very serious issue. It increases until it just crashes (in my case ~400mb and cpu 7% on galaxy s5)
Environment
Android
react-native: 0.53.0
react-native-maps: 0.20.0
Steps to Reproduce
(Write your steps here:)
Expected Behavior
Memory and cpu should be somewhat in the same range, now it just simply adding up. Possibly something to do with lifecycle methods.
Actual Behavior
Every single time you switch to MapView it will add cpu and memory until it crashes.
Reproducible Demo
If there's a need i can make a demo project, but this is just basic stuff, 2 components with one of them having a mapview and simply switching between them.
The text was updated successfully, but these errors were encountered: