Closed perracodex closed 2 years ago
I'm closing the issue, as I've found out that glide's GifDecoder always loads the full GIF data into memory by design. It decodes each from dynamically one at a time, yet the actual GIF data is always loaded into memory. I was with the wrong impression that was loading 1 frame at time from disk, but this is not the case. Probably the GifDecoder needs some refactoring for efficiency, maybe using the NDK.
Glide Version: 4.12.0
Integration libraries: None
Device/Android Version: Redmi Note 10 Pro / Android 11
Issue details / Repro steps / Use case background:
This is actually an edge case, but shows that there may be a problem with the GIF decoder or related resource decoder. The issue happens when trying to load a unusually large GIF. For my test I used a 194Mb GIF file with a 360x640 resolution. The GIF fails to load showing an OutOfMemoryError issue in the logcat.
The GIF load configuration is set to skip Memory & Disk caches. Even tested overriding the max size to something very low as 1 pixel size to see what happens, but still throws the error.
Glide load line /
GlideModule
(if any) / list Adapter code (if any):Stack trace / LogCat: