-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Pseudo memory leak after removing many Views from screen (ios) #21454
Comments
Hey thanks for the report, it indeed seems to be a memory leak issue 🤔 Have you also tried to investigate it following the suggestions from this article? Do you have a similar effect on Android too? |
Hey @kelset, thanks for your response. I've tried everything I was particularly excited about the I'll try to profile on Android to check if the same behavior is happening, but in the production app only ios reported OOM issues. |
@kelset, some impressions after profiling on Android:
I was not able to force GC in ios, and given that it holds the memory until the OOM crash I'm not sure it would be helpful anyway. For this reason I'm assuming that the issue is in ios, or at least it's more severe in this platform. Thanks again for you attention on the matter. |
Hey @leonardocarvalho thank you so much for the detailed investigation, I'll show this to the Core since it's a pretty important issue IMHO. |
Hi @kelset , Did the Core have time to take a look on this issue? If there's anything I could do to help just let me know. |
Hey Leonardo, thanks for the ping - sadly noone was able to check it last time I linked it, I'll try again next week since this week there is ReactConf and the JSI is landing too, so a lot is moving. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Environment
Description
Disclaimer: Yet not totally sure if the behavior is an issue, but as it's causing a somewhat large amount of crashes in my app I'm considering it to be a bug.
The issue is that after performing operations expected to have no impact in memory consumption the total memory usage is higher then the previous baseline. Trying to isolate the cause I ended up with a fairly simple app (shown below) that adds and removes views from the screen and have this pseudo memory leak.
XCode tools to track memory indicate that: (all tests made in production scheme)
1. Adding some views and then removing them memory consumption increases
2. Add and remove the same amount of views again doesn't increase the memory consumption, but if a larger number of views are added some more memory leak
Note that the second peak in the graph is lower than the first. Also, from time to time, some of the retained memory is freed (not in the graph), but I couldn't grasp the possible trigger. Considering this pattern I'm inclined to think this is some kind of cache and not a leak, but I couldn't find anything about it.
In my production app a similar pattern can be repeated until the device runs out of memory. This was tested in iPhone5, but there are similar reports on Crashlytics for other devices.
I was worried that this could be a simple to answer question, so I tried StackOverflow without success so far.
Reproducible Demo
The issue is reproducible by
react-native init
and changing theApp.js
to beThe text was updated successfully, but these errors were encountered: