java.lang.OutOfMemoryError

Failed to allocate a 4147212 byte allocation with 2012184 free bytes and 1965KB until OOM

Samebug tips4

Try adding these lines to your manifest: "android:hardwareAccelerated="false"" and "android:largeHeap="true"" as it seems to work for some cases. See also this article about handling bitmaps on android's documentation: https://goo.gl/8LVrzp

This was issue #159 in Fresco, and was fixed recently, in v1.3.0.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web2786

  • Failed to allocate a 4147212 byte allocation with 2012184 free bytes and 1965KB until OOM
  • Failed to allocate a 4147212 byte allocation with 2012184 free bytes and 1965KB until OOM
  • via GitHub by astrazzari72
    , 1 year ago
    Failed to allocate a 1048588 byte allocation with 342216 free bytes and 334KB until OOM
  • Stack trace

    • 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)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 9 months ago
    15 times, 11 months ago
    Once, 11 months ago
    11 times, 1 year ago
    28 times, 1 year ago
    67 more bugmates