java.lang.OutOfMemoryError

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

tip

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

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

  • About the error: 1) The error occurs when there's no more space for messages in the status bar. 2) The following message is displayed after the error: "Unfortunately, the process com.android.systemui has stopped". 3) When I trying to post the message, the following preview is displayed: "Preview Crash Report Submission subject [CRASH] com.android.keyguard threw java.lang.OutOfMemoryError Submission content java.lang.OutOfMemoryError at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:810) at android.graphics.Bitmap.createBitmap(Bitmap.java:787) at android.graphics.Bitmap.createBitmap(Bitmap.java:754) at com.android.keyguard.KeyguardViewManager$ViewManagerHost.setCustomBackground(KeyguardViewManager.java:318) at com.android.keyguard.KeyguardViewManager$5.run(KeyguarViewManager.java:877) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5146) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612) at dalvik.system.NativeStart.main(Native Method)". 4) After the described message in item 3 be displayed, the screen is automatically locked. 5) When unlock the screen, I try to send the bug report, but the following message is displayed: "Unfortunately, CM Bug Report has stopped". (This is an intermittent error, sometimes it was possible to send the error report via the CM Bug Report). 6) After the error, while the number of messages in the status bar is at maximum level, any app that needs to display a message in the status bar is stopped. 7) Observation: It's an error that occurs to me since version "cm-11-20140708-SNAPSHOT-M8-jflte" (http://download.cyanogenmod.org/get/jenkins/75215/cm-11-20140708-SNAPSHOT-M8-jflte.zip). I have not reported this before (using the JIRA.) because sometimes the CM Bug Report app worked. ==================== The steps I followed to get simulate the error using the Twitter app: 1) I activated the Twitter notifications in the status bar: Twitter> Settings> User account> Notifications> Tweets> Check box. 2) Observation 1: the status bar is already occupied by five fixed messages that can't be removed. (e.g., the "Privacy Guard active" message). 3) After the Twitter app display 25 messages in the status bar, the errors begin. 4) After the "Unfortunately, the process com.android.systemui has stopped" error, the following errors are displayed: "Unfortunately, Twitter has stopped", "Unfortunately, WhatsApp has stopped", "Unfortunately, Apollo has stopped", "Unfortunately, K-9 Mail was stopped". (i.e., any app that tries to use the status bar is stopped.)
    via by Cassius Clay,
  • About the error: 1) The error occurs when there's no more space for messages in the status bar. 2) The following message is displayed after the error: "Unfortunately, the process com.android.systemui has stopped". 3) When I trying to post the message, the following preview is displayed: "Preview Crash Report Submission subject [CRASH] com.android.keyguard threw java.lang.OutOfMemoryError Submission content java.lang.OutOfMemoryError at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:810) at android.graphics.Bitmap.createBitmap(Bitmap.java:787) at android.graphics.Bitmap.createBitmap(Bitmap.java:754) at com.android.keyguard.KeyguardViewManager$ViewManagerHost.setCustomBackground(KeyguardViewManager.java:318) at com.android.keyguard.KeyguardViewManager$5.run(KeyguarViewManager.java:877) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5146) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612) at dalvik.system.NativeStart.main(Native Method)". 4) After the described message in item 3 be displayed, the screen is automatically locked. 5) When unlock the screen, I try to send the bug report, but the following message is displayed: "Unfortunately, CM Bug Report has stopped". (This is an intermittent error, sometimes it was possible to send the error report via the CM Bug Report). 6) After the error, while the number of messages in the status bar is at maximum level, any app that needs to display a message in the status bar is stopped. 7) Observation: It's an error that occurs to me since version "cm-11-20140708-SNAPSHOT-M8-jflte" (http://download.cyanogenmod.org/get/jenkins/75215/cm-11-20140708-SNAPSHOT-M8-jflte.zip). I have not reported this before (using the JIRA.) because sometimes the CM Bug Report app worked. ==================== The steps I followed to get simulate the error using the Twitter app: 1) I activated the Twitter notifications in the status bar: Twitter> Settings> User account> Notifications> Tweets> Check box. 2) Observation 1: the status bar is already occupied by five fixed messages that can't be removed. (e.g., the "Privacy Guard active" message). 3) After the Twitter app display 25 messages in the status bar, the errors begin. 4) After the "Unfortunately, the process com.android.systemui has stopped" error, the following errors are displayed: "Unfortunately, Twitter has stopped", "Unfortunately, WhatsApp has stopped", "Unfortunately, Apollo has stopped", "Unfortunately, K-9 Mail was stopped". (i.e., any app that tries to use the status bar is stopped.)
    via by Cassius Clay,
  • Out of memory on tablets
    via GitHub by reybridge
    ,
  • Out of memory errors
    via GitHub by yanivagman
    ,
  • OutOfMemoryError
    via GitHub by chathudan
    ,
  • Out of memory while creating bitmap in android
    via by Unknown author,
  • Out of memory
    via GitHub by androidbyxj
    ,
  • OutOfMemoryError
    via GitHub by kamoljan
    ,
    • java.lang.OutOfMemoryError at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:810) at android.graphics.Bitmap.createBitmap(Bitmap.java:787) at android.graphics.Bitmap.createBitmap(Bitmap.java:754) at com.android.keyguard.KeyguardViewManager$ViewManagerHost.setCustomBackground(KeyguardViewManager.java:318) at com.android.keyguard.KeyguardViewManager$5.run(KeyguarViewManager.java:877) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5146) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612) at dalvik.system.NativeStart.main(Native Method)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    aakashaakash
    1 times, last one,
    Agócs TamásAgócs Tamás
    3 times, last one,
    bayukresnobayukresno
    7 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    11 more bugmates