java.lang.OutOfMemoryError

Failed to allocate a 26211852 byte allocation with 16777216 free bytes and 21MB 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

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

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

Solutions on the web2788

  • Failed to allocate a 26211852 byte allocation with 16777216 free bytes and 21MB until OOM
  • Failed to allocate a 36000012 byte allocation with 16777216 free bytes and 21MB until OOM
  • via Stack Overflow by Arshiya
    , 3 months ago
    Failed to allocate a 38125292 byte allocation with 16777216 free bytes and 21MB until OOM
  • Stack trace

    • java.lang.OutOfMemoryError: Failed to allocate a 26211852 byte allocation with 16777216 free bytes and 21MB until OOM at dalvik.system.VMRuntime.newNonMovableArray(VMRuntime.java) at android.graphics.BitmapFactory.nativeDecodeAsset(BitmapFactory.java) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:856) at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:675) at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:2228) at android.content.res.Resources.loadDrawableForCookie(Resources.java:4211) at android.content.res.Resources.loadDrawable(Resources.java:4085) at android.content.res.Resources.getDrawable(Resources.java:2005) at android.content.res.Resources.getDrawable(Resources.java:1987) at android.content.res.Resources.getDrawable(Resources.java:1961) at com.facebook.drawee.generic.GenericDraweeHierarchyInflater.getDrawable(SourceFile:227) at com.facebook.drawee.generic.GenericDraweeHierarchyInflater.updateBuilder(SourceFile:116) at com.facebook.drawee.generic.GenericDraweeHierarchyInflater.inflateBuilder(SourceFile:77) at com.facebook.drawee.view.GenericDraweeView.inflateHierarchy(SourceFile:58) at com.facebook.drawee.view.GenericDraweeView.<init>(SourceFile) at com.facebook.drawee.view.SimpleDraweeView.<init>(SourceFile) at java.lang.reflect.Constructor.newInstance(Constructor.java) at android.view.LayoutInflater.createView(LayoutInflater.java:631) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716) at android.view.LayoutInflater.rInflate(LayoutInflater.java:847) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.rInflate(LayoutInflater.java:855) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.rInflate(LayoutInflater.java:855) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.inflate(LayoutInflater.java:527) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at com.xxx.xxxFragment.onCreateView(SourceFile:130) at android.support.v4.app.Fragment.performCreateView(SourceFile:1962) at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1067) at android.support.v4.app.FragmentManagerImpl.attachFragment(SourceFile:1426) at android.support.v4.app.BackStackRecord.run(SourceFile:728) at android.support.v4.app.FragmentManagerImpl.execPendingActions(SourceFile:1613) at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(SourceFile:570) at android.support.v4.app.FragmentPagerAdapter.finishUpdate(SourceFile:141) at android.support.v4.view.ViewPager.populate(SourceFile:1106) at android.support.v4.view.ViewPager.populate(SourceFile:952) at android.support.v4.view.ViewPager.onMeasure(SourceFile:1474) at android.view.View.measure(View.java:20151) at android.widget.LinearLayout.measureVertical(LinearLayout.java:900) at android.widget.LinearLayout.onMeasure(LinearLayout.java:629) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6328) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6328) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464) at android.widget.LinearLayout.measureVertical(LinearLayout.java:747) at android.widget.LinearLayout.onMeasure(LinearLayout.java:629) at android.view.View.measure(View.java:20151) at android.support.v4.widget.DrawerLayout.onMeasure(SourceFile:940) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6328) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.support.v7.widget.ContentFrameLayout.onMeasure(SourceFile:135) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6328) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464) at android.widget.LinearLayout.measureVertical(LinearLayout.java:747) at android.widget.LinearLayout.onMeasure(LinearLayout.java:629) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6328) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6328) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464) at android.widget.LinearLayout.measureVertical(LinearLayout.java:747) at android.widget.LinearLayout.onMeasure(LinearLayout.java:629) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6328) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:3158) at android.view.View.measure(View.java:20151) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2594) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1549) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1841) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7403) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920) at android.view.Choreographer.doCallbacks(Choreographer.java:695) at android.view.Choreographer.doFrame(Choreographer.java:631) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7229) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

    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

    73 times, 8 months ago
    Unknown user
    Once, 11 months ago
    2 times, 11 months ago
    Unknown user
    Once, 11 months ago
    4 times, 1 year ago
    69 more bugmates