-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Fix Memory leak #44002
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
[Cache] Fix Memory leak #44002
Conversation
Hey! To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done? Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review. Cheers! Carsonbot |
@Jeroeny can you please try this patch a report back if it fixes your issue? |
It no longer seems to leak in the reproducer after having applied these changes. 👍 |
This property has been added to save calling Since #40317, it's possible to skip calling This property has been added with the assumption that the number of different keys is upper bounded. |
i agree with the idea of 1000 keys, a @Jeroeny ? |
Sounds good to me. Upon reaching the limit, do you want to purge the entire array or slice it so that it's maxed out at 1000 items (like the ArrayAdapter cache) ? |
The logic in ArrayAdapter is too involving for this. I'd suggest halving the array instead: |
881275c
to
2ad61b8
Compare
Thank you @a1812. |
Rough decision as an example of how to stop a leak