java.lang.OutOfMemoryError: Failed to allocate a 37765132 byte allocation with 8290820 free bytes and 7MB 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 GitHub by ctodobom
, 10 months ago
Failed to allocate a 37765132 byte allocation with 8290820 free bytes and 7MB until OOM
via Stack Overflow by Salivan
, 1 year ago
Failed to allocate a 4194316 byte allocation with 1627608 free bytes and 1589KB until OOM
via Stack Overflow by Whiz
, 1 year ago
Failed to allocate a 4194316 byte allocation with 3271760 free bytes and 3MB until OOM
via Stack Overflow by Alberto
, 2 years ago
Failed to allocate a 16777228 byte allocation with 2655368 free bytes and 2MB until OOM
via GitHub by tonyr59h
, 2 months ago
Failed to allocate a 6885388 byte allocation with 4572224 free bytes and 4MB until OOM
via Stack Overflow by Maven
, 1 year ago
Failed to allocate a 108000012 byte allocation with 10607192 free bytes and 10MB until OOM
java.lang.OutOfMemoryError: Failed to allocate a 37765132 byte allocation with 8290820 free bytes and 7MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:838)
at android.graphics.Bitmap.createBitmap(Bitmap.java:815)
at android.graphics.Bitmap.createBitmap(Bitmap.java:746)
at com.todobom.opennotescanner.FullScreenImageAdapter.instantiateItem(FullScreenImageAdapter.java:67)
at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:870)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1054)
at android.support.v4.view.ViewPager.populate(ViewPager.java:952)
at android.view.View.measure(View.java:17565)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:727)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:463)
at android.view.View.measure(View.java:17565)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5537)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
at android.view.View.measure(View.java:17565)
at android.view.View.measure(View.java:17565)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5537)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
at android.view.View.measure(View.java:17565)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5537)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17565)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5537)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
at android.view.View.measure(View.java:17565)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2045)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1196)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1409)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1084)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5990)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
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:905)

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
Samebug visitor profile picture
Unknown user
Once, 1 month ago
3 times, 1 month ago
8 times, 8 months ago
69 more bugmates

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