Fresco: java.lang.OutOfMemoryError: Failed to allocate a 4147212 byte allocation with 2012184 free bytes and 1965KB until OOM

Created on 30 Jul 2016  ·  8Comments  ·  Source: facebook/fresco

java.lang.OutOfMemoryError: Failed to allocate a 4147212 byte allocation with 2012184 free bytes and 1965KB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:847)
at android.graphics.Bitmap.createBitmap(Bitmap.java:817)
at android.graphics.Bitmap.createBitmap(Bitmap.java:784)
at com.facebook.imagepipeline.memory.BitmapPool.alloc(BitmapPool.java:55)
at com.facebook.imagepipeline.memory.BitmapPool.alloc(BitmapPool.java:30)
at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:259)
at com.facebook.imagepipeline.platform.ArtDecoder.decodeStaticImageFromStream(ArtDecoder.java:137)
at com.facebook.imagepipeline.platform.ArtDecoder.decodeFromEncodedImage(ArtDecoder.java:81)
at com.facebook.imagepipeline.decoder.ImageDecoder.decodeStaticImage(ImageDecoder.java:128)
at com.facebook.imagepipeline.decoder.ImageDecoder.decodeImage(ImageDecoder.java:94)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.doDecode(DecodeProducer.java:189)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$200(DecodeProducer.java:97)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$1.run(DecodeProducer.java:129)
at com.facebook.imagepipeline.producers.JobScheduler.doJob(JobScheduler.java:207)
at com.facebook.imagepipeline.producers.JobScheduler.access$000(JobScheduler.java:27)
at com.facebook.imagepipeline.producers.JobScheduler$1.run(JobScheduler.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:43)
at java.lang.Thread.run(Thread.java:831)

Most helpful comment

Closing old issue due to lack of updates

All 8 comments

图库选择多次操作发生omm了 ,用的是最新0.12.0的版本

The most common reason for this happening is loading too big images(just like choose pic from gallery). If the image to be loaded is of considerably bigger size than the view hosting it, it should be resized.

tips:
Use third-party lib,read document first.

大兄弟 ,你这样提问很丢脸的.

我安装使用文档对图片进行了大小的调整了
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(url))
.setResizeOptions(new ResizeOptions(80, 80))
.build();
还是出现了omm

you should use english ,otherwise ,may chinese can realise what the problem you have meet

I adjusted the size of the picture in accordance with the use of the document.
Request ImageRequest = ImageRequestBuilder.newBuilderWithSource (Uri.parse (URL))
.setResizeOptions (ResizeOptions new (80, 80))
.build ();
OMM crash exception occurred.To Library list multiple operations

@jmheart

Did you try to load PNG files? Because resizing only supports JPEG files, if you load PNG files, you'd better consider downsampling options as well.

Closing old issue due to lack of updates

@erikandre i updates but not work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amodkanthe picture amodkanthe  ·  3Comments

cococool picture cococool  ·  4Comments

rhettor picture rhettor  ·  3Comments

eresid picture eresid  ·  4Comments

sungerk picture sungerk  ·  3Comments