java.lang.OutOfMemoryError: Failed to allocate a 300560012 byte allocation with 7219628 free bytes and 181MB until OOM

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

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

,
Expert tip

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

Solutions on the web

via Stack Overflow by hariharan ayyasamy
, 1 year ago
Failed to allocate a 300560012 byte allocation with 7219628 free bytes and 181MB until OOM
via GitHub by Svajoklis-
, 1 year ago
Failed to allocate a 203079692 byte allocation with 4194304 free bytes and 53MB until OOM
via Stack Overflow by Maksim Dmitriev
, 6 months ago
Failed to allocate a 233280012 byte allocation with 10567360 free bytes and 176MB until OOM
via GitHub by locomain
, 1 year ago
Failed to allocate a 24385548 byte allocation with 1477232 free bytes and 1442KB until OOM
via GitHub by peterneubauer
, 1 year ago
Failed to allocate a 10077708 byte allocation with 4463250 free bytes and 4MB until OOM
via GitHub by yigepang
, 2 months ago
Failed to allocate a 3126652 byte allocation with 905352 free bytes and 884KB until OOM
java.lang.OutOfMemoryError: Failed to allocate a 300560012 byte allocation with 7219628 free bytes and 181MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:635)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:611)
at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:391)
at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:417)
at util.ExpenseUtil.compressImage(ExpenseUtil.java:380)
at activities.UploadReceipt.handleSendImage(UploadReceipt.java:250)
at activities.UploadReceipt.receiveSharedFile(UploadReceipt.java:128)
at activities.UploadReceipt.onCreate(UploadReceipt.java:103)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
33 times, 1 year ago
3 times, 1 month ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
70 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.