-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Consider dropping Bitmaps when View not visible #2520
Comments
I wouldn't worry about app not in foreground. Since each app has so little VM heap associated to it, there's no point in cleaning that up. It is all yours (and fully reserved to you, even if it's empty) until Android thinks to kill the whole process, at which point it doesn't matter any more how full your quota was. |
We actually used to do this in G+. It leads to a pretty substantial increase in grey squares/ui jank if users navigate back and forth between image heavy Activities. The image cache gets blown out quickly or has to be very large to make up for the difference. It's a good idea as an option or on low RAM devices though if developers have control over when it happens. |
Also returns appropriate ViewTarget implementations from into(ImageView) so that the method can easily be chained. Related to bumptech#2520.
@shaybarak I have something that might work, though it's a bit of a hack in its current form. Let me know if you have someone in mind who'd be interested in trying it. |
Also returns appropriate ViewTarget implementations from into(ImageView) so that the method can easily be chained. Related to bumptech#2520.
Also returns appropriate ViewTarget implementations from into(ImageView) so that the method can easily be chained. Related to bumptech#2520.
Added here: d0fd967 |
In many apps that I looked at, Bitmaps were the top contributor to RAM usage. Often times these Bitmaps are held by Views that are not visible, either because the app is not in the foreground, or because the View is tied to a Fragment that is currently not visible but also not destroyed.
I wonder if Glide could allow developers to specify that certain Views should aggressively release their Bitmaps when they're not visible, and re-inflate the Bitmaps when they become visible again.
The text was updated successfully, but these errors were encountered: