Skip to content
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

OOM loading huge gifs #83

Closed
sjudd opened this issue Jul 11, 2014 · 2 comments
Closed

OOM loading huge gifs #83

sjudd opened this issue Jul 11, 2014 · 2 comments

Comments

@sjudd
Copy link
Collaborator

sjudd commented Jul 11, 2014

A 3840x2880 example is http://media4.giphy.com/media/ToMjGpquWkOQon5nAvS/giphy.gif.

Probably the most reasonable thing is to catch the exception, allow the load to fail, and encourage users to not try to load gigantic gifs, but we may also be able to find some reasonable way of downsampling GIFs the same way we do Bitmaps.

@sjudd sjudd added this to the 3.0 milestone Jul 11, 2014
@sjudd sjudd modified the milestones: 3.4, 3.0 Sep 1, 2014
@sjudd sjudd modified the milestones: 3.5, 3.4 Oct 23, 2014
sjudd added a commit to sjudd/glide that referenced this issue Nov 25, 2014
Doing so means we go from using 3x the necessary
memory in the worst case to 2x, and in the best
case we go from using 2x the necessary memory to
using exactly what we need (for images larger than
the buffer size). 

Progress toward bumptech#83
@HongminHan
Copy link

I have changed the source code follow sjudd@b504aa2 ,does not work.
Out of memory on a 4194320-byte allocation.
"fifo-pool-thread-1" prio=5 tid=31 RUNNABLE
...
at com.bumptech.glide.load.resource.gif.GifResourceDecoder.inputStreamToBytes...

and my gif url is http://wankr-doubi.oss-cn-qingdao.aliyuncs.com/8ab85cde-b3e0-4a44-aacf-73f293f4b99f.gif


I test it on another device, with no problem.
mayby my first device with low memory?

@sjudd sjudd removed this from the 3.5 milestone Jan 21, 2015
@sjudd
Copy link
Collaborator Author

sjudd commented Jun 9, 2015

Power of 2 downsampling was added here: 8be38e5.

We still don't downsample all temporary data, so there's more work to do here. Specifically we need to find a way to downsample the byte array that is used to store pointers into the color table during the decode process for each frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants