3

When using Fresco im detecting on some devices (All ART, none Dalvik) are getting OOM exceptions. The stacktrace looks like this:

java.lang.OutOfMemoryError·Failed to allocate a 1000012 byte allocation with 834924 free bytes and 815KB until OOM
Raw
VMRuntime.java:-2dalvik.system.VMRuntime.newNonMovableArray 
Bitmap.java:-2android.graphics.Bitmap.nativeCreate  
Bitmap.java:908android.graphics.Bitmap.createBitmap 
Bitmap.java:879android.graphics.Bitmap.createBitmap 
Bitmap.java:846android.graphics.Bitmap.createBitmap 
BitmapPool.java:55com.facebook.imagepipeline.memory.BitmapPool.alloc    
BitmapPool.java:30com.facebook.imagepipeline.memory.BitmapPool.alloc    
BasePool.java:259com.facebook.imagepipeline.memory.BasePool.get 
ArtDecoder.java:137com.facebook.imagepipeline.platform.ArtDecoder.decodeStaticImageFromStream   
ArtDecoder.java:120com.facebook.imagepipeline.platform.ArtDecoder.decodeJPEGFromEncodedImage    
ImageDecoder.java:154com.facebook.imagepipeline.decoder.ImageDecoder.decodeJpeg 
ImageDecoder.java:85com.facebook.imagepipeline.decoder.ImageDecoder.decodeImage 
DecodeProducer.java:194com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.doDecode  
DecodeProducer.java:97com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$200 
DecodeProducer.java:129com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$1.run

It does makes sense the OOM, since the device has around 800kb free, while the image is close to the 1mb. The question is.. why would it happen? (Devices are all different, happening from android 5.0 to 6).

We currently are not resizing there, but we are setting a scale type and the view has specific bounds.

Also another question would be:

  • Does resize work in pre decode??

  • Scale types (eg CENTER_INSIDE) happen pre decode also right?

Im most certainly this might be fixed by setting resize options to the image request, but I prefer to understand how this work first.

Thanks!

0 Answers0