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

java.lang.NullPointerException at com.bumptech.glide.util.Util.getBitmapByteSize #331

Closed
van11 opened this issue Feb 6, 2015 · 4 comments
Labels
Milestone

Comments

@van11
Copy link

van11 commented Feb 6, 2015

Using glide 3.5.1, crashing a lot when onTrimMemory is triggered.

E/AndroidRuntime( 8832): java.lang.NullPointerException
E/AndroidRuntime( 8832): at com.bumptech.glide.util.Util.getBitmapByteSize(Util.java:79)
E/AndroidRuntime( 8832): at com.bumptech.glide.load.engine.bitmap_recycle.SizeStrategy.getSize(SizeStrategy.java:86)
E/AndroidRuntime( 8832): at com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool.trimToSize(LruBitmapPool.java:171)
E/AndroidRuntime( 8832): at com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool.clearMemory(LruBitmapPool.java:154)
E/AndroidRuntime( 8832): at com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool.trimMemory(LruBitmapPool.java:161)
E/AndroidRuntime( 8832): at com.bumptech.glide.Glide.trimMemory(Glide.java:381)

@sjudd sjudd added the bug label Feb 6, 2015
@sjudd
Copy link
Collaborator

sjudd commented Feb 6, 2015

Thanks for the report.

Are you able to reliably reproduce this and if so, can you provide steps to do so? Are you using Glide 3.5.1? What version of Android are you using?

@sjudd sjudd added this to the 3.5.2 milestone Feb 7, 2015
@van11
Copy link
Author

van11 commented Feb 8, 2015

Try using phone, emulator with very low memory, or heavy loaded, but I guess it would not be reproducible 100%. Then onTrimMemory should be triggered. I used Android 4.4.4. And yes, Glide 3.5.1

@sjudd sjudd closed this as completed in ca2907f Feb 8, 2015
@sjudd
Copy link
Collaborator

sjudd commented Feb 9, 2015

I tried for a while and wasn't able to reproduce it.

The above commit avoids the exception and prints some verbose logging. If you see that log go off and can paste the output here, I'd appreciate it!

@van11
Copy link
Author

van11 commented Feb 27, 2015

Looks like now the problem is solved, many thanks! :)

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

No branches or pull requests

2 participants