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

Error Drawable not shown on OOM error #3404

Closed
grote opened this issue Nov 14, 2018 · 7 comments
Closed

Error Drawable not shown on OOM error #3404

grote opened this issue Nov 14, 2018 · 7 comments

Comments

@grote
Copy link

grote commented Nov 14, 2018

Glide Version: 4.8.0

Integration libraries: None

Device/Android Version: Android 28 emulator

Issue details / Repro steps / Use case background:

If I load a very large image like this one: error_large

Glide fails of course to load it, but it doesn't show the error drawable as it should. The image just stays blank. Note that RequestListener#loadFailed() gets called. But even calling target.onLoadFailed(errorDrawable) there doesn't show the error drawable.

Glide load line / GlideModule (if any) / list Adapter code (if any):

		GlideApp.with(imageView)
				.load(url)
				.error(R.drawable.ic_image_broken)
				.into(imageView)
				.waitForLayout();

Stack trace / LogCat:

W/r.android.debu: Throwing OutOfMemoryError "Failed to allocate a 268435468 byte allocation with 6291456 free bytes and 114MB until OOM, max allowed footprint 289082504, growth limit 402653184"
@grote
Copy link
Author

grote commented Nov 14, 2018

Note that there's a different kind of OOM error (caused by a different type of test image) that does show the error drawable as expected:

2018-11-14 15:01:58.092 W/Glide: Load failed for org.briarproject.briar.android.conversation.AttachmentItem@ef80b1e with size [394x551]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
    There were 2 causes:
    java.lang.OutOfMemoryError(null)
    java.lang.OutOfMemoryError(null)
     call GlideException#logRootCauses(String) for more detail
      Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{->Object->Drawable}, LOCAL
    There were 2 causes:
    java.lang.OutOfMemoryError(null)
    java.lang.OutOfMemoryError(null)
     call GlideException#logRootCauses(String) for more detail
        Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{->GifDrawable->Drawable}
        Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{->Bitmap->Drawable}
    There was 1 cause:
    java.lang.OutOfMemoryError(null)
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class java.lang.OutOfMemoryError: 
        Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{->BitmapDrawable->Drawable}
    There was 1 cause:
    java.lang.OutOfMemoryError(null)
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class java.lang.OutOfMemoryError: 
2018-11-14 15:01:58.093 I/Glide: Root cause (1 of 2)
    java.lang.OutOfMemoryError
        at android.graphics.Bitmap.nativeCreate(Native Method)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:1046)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:1000)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:950)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:911)
        at com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool.createBitmap(LruBitmapPool.java:149)
        at com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool.getDirty(LruBitmapPool.java:142)
        at com.bumptech.glide.load.resource.bitmap.Downsampler.setInBitmap(Downsampler.java:686)
        at com.bumptech.glide.load.resource.bitmap.Downsampler.decodeFromWrappedStreams(Downsampler.java:296)
        at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:206)
        at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:62)
        at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:18)
        at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:72)
        at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:55)
        at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:45)

@stale
Copy link

stale bot commented Nov 22, 2018

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

@stale stale bot added the stale label Nov 22, 2018
@grote
Copy link
Author

grote commented Nov 22, 2018

Looks like nobody has time to look at this right now. Maybe I can least make the bot go away until that changes.

@stale stale bot removed the stale label Nov 22, 2018
@stale
Copy link

stale bot commented Nov 29, 2018

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

@stale stale bot added the stale label Nov 29, 2018
@grote
Copy link
Author

grote commented Nov 29, 2018

@TWiStErRob do you want to have a quick look at this ticket? If you think it isn't important enough, I'll stop fighting the closing bot.

@stale stale bot removed the stale label Nov 29, 2018
@sjudd
Copy link
Collaborator

sjudd commented Dec 3, 2018

Are you able to attach a simple sample app that reproduces this? Consider also: http://bumptech.github.io/glide/tut/failing-test-cases.html. Seems like this would be simple to add to one of the existing emulator tests.

@stale
Copy link

stale bot commented Dec 10, 2018

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

@stale stale bot added the stale label Dec 10, 2018
@stale stale bot closed this as completed Dec 18, 2018
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

2 participants