java.lang.OutOfMemoryError: Failed to allocate a 23887884 byte allocation with 8219096 free bytes and 7MB until OOM

Appcelerator JIRA | Andrey Tkachenko | 11 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I got OutOfMemory with this code. Steps to reproduce: 1. Create default Alloy project 2. Load and save big image to the assets 3. Add this test code to the click event handler 4. Click several times to the view with click event attached 5. See result in log Image: https://static.pexels.com/photos/479/landscape-nature-sunset-trees.jpg {code:javascript|title=test code} var iv = Ti.UI.createImageView({ width : Ti.UI.SIZE, height : Ti.UI.SIZE, image : '/images/landscape-nature-sunset-trees.jpg' }); var blob = iv.toBlob(); iv.image = null; iv = null; Ti.API.info('OK!'); {code} {code:text|title=error log} [ERROR] TiDrawableReference: (KrollRuntimeThread) [6078,6078] Unable to load bitmap. Not enough memory: Failed to allocate a 23887884 byte allocation with 8219096 free bytes and 7MB until OOM [ERROR] TiDrawableReference: java.lang.OutOfMemoryError: Failed to allocate a 23887884 byte allocation with 8219096 free bytes and 7MB until OOM [ERROR] TiDrawableReference: at dalvik.system.VMRuntime.newNonMovableArray(Native Method) [ERROR] TiDrawableReference: at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) [ERROR] TiDrawableReference: at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609) [ERROR] TiDrawableReference: at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:348) [ERROR] TiDrawableReference: at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:300) [ERROR] TiDrawableReference: at ti.modules.titanium.ui.widget.TiUIImageView.toBlob(TiUIImageView.java:947) [ERROR] TiDrawableReference: at ti.modules.titanium.ui.ImageViewProxy.toBlob(ImageViewProxy.java:93) [ERROR] TiDrawableReference: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] TiDrawableReference: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [ERROR] TiDrawableReference: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:918) [ERROR] TiDrawableReference: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1141) [ERROR] TiDrawableReference: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:356) [ERROR] TiDrawableReference: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] TiDrawableReference: at android.os.Looper.loop(Looper.java:148) [ERROR] TiDrawableReference: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118) {code}

    Appcelerator JIRA | 11 months ago | Andrey Tkachenko
    java.lang.OutOfMemoryError: Failed to allocate a 23887884 byte allocation with 8219096 free bytes and 7MB until OOM
  2. 0

    I got OutOfMemory with this code. Steps to reproduce: 1. Create default Alloy project 2. Load and save big image to the assets 3. Add this test code to the click event handler 4. Click several times to the view with click event attached 5. See result in log Image: https://static.pexels.com/photos/479/landscape-nature-sunset-trees.jpg {code:javascript|title=test code} var iv = Ti.UI.createImageView({ width : Ti.UI.SIZE, height : Ti.UI.SIZE, image : '/images/landscape-nature-sunset-trees.jpg' }); var blob = iv.toBlob(); iv.image = null; iv = null; Ti.API.info('OK!'); {code} {code:text|title=error log} [ERROR] TiDrawableReference: (KrollRuntimeThread) [6078,6078] Unable to load bitmap. Not enough memory: Failed to allocate a 23887884 byte allocation with 8219096 free bytes and 7MB until OOM [ERROR] TiDrawableReference: java.lang.OutOfMemoryError: Failed to allocate a 23887884 byte allocation with 8219096 free bytes and 7MB until OOM [ERROR] TiDrawableReference: at dalvik.system.VMRuntime.newNonMovableArray(Native Method) [ERROR] TiDrawableReference: at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) [ERROR] TiDrawableReference: at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609) [ERROR] TiDrawableReference: at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:348) [ERROR] TiDrawableReference: at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:300) [ERROR] TiDrawableReference: at ti.modules.titanium.ui.widget.TiUIImageView.toBlob(TiUIImageView.java:947) [ERROR] TiDrawableReference: at ti.modules.titanium.ui.ImageViewProxy.toBlob(ImageViewProxy.java:93) [ERROR] TiDrawableReference: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] TiDrawableReference: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [ERROR] TiDrawableReference: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:918) [ERROR] TiDrawableReference: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1141) [ERROR] TiDrawableReference: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:356) [ERROR] TiDrawableReference: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] TiDrawableReference: at android.os.Looper.loop(Looper.java:148) [ERROR] TiDrawableReference: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118) {code}

    Appcelerator JIRA | 11 months ago | Andrey Tkachenko
    java.lang.OutOfMemoryError: Failed to allocate a 23887884 byte allocation with 8219096 free bytes and 7MB until OOM
  3. 0

    First time in android studio

    Stack Overflow | 1 year ago | Nick Dettore
    java.lang.OutOfMemoryError: Failed to allocate a 144000012 byte allocation with 1048576 free bytes and 63MB until OOM
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Java.lang.outofMemory Error

    Stack Overflow | 2 months ago | Sir George
    java.lang.OutOfMemoryError: Failed to allocate a 144764940 byte allocation with 16777120 free bytes and 27MB until OOM
  6. 0

    When fling a ListView with images´╝îthe app threw OutOfMemoryError

    GitHub | 2 years ago | licheedev
    java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.OutOfMemoryError

    Failed to allocate a 23887884 byte allocation with 8219096 free bytes and 7MB until OOM

    at dalvik.system.VMRuntime.newNonMovableArray()
  2. Android Platform
    BitmapFactory.decodeStream
    1. dalvik.system.VMRuntime.newNonMovableArray(Native Method)
    2. android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
    3. android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)
    3 frames
  3. org.appcelerator.titanium
    TiDrawableReference.getBitmap
    1. org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:348)
    2. org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:300)
    2 frames
  4. ti.modules.titanium
    ImageViewProxy.toBlob
    1. ti.modules.titanium.ui.widget.TiUIImageView.toBlob(TiUIImageView.java:947)
    2. ti.modules.titanium.ui.ImageViewProxy.toBlob(ImageViewProxy.java:93)
    2 frames
  5. org.appcelerator.kroll
    KrollProxy.handleMessage
    1. org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
    2. org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
    3. org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:918)
    4. org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1141)
    4 frames
  6. org.appcelerator.titanium
    TiViewProxy.handleMessage
    1. org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:356)
    1 frame
  7. Android Platform
    Looper.loop
    1. android.os.Handler.dispatchMessage(Handler.java:98)
    2. android.os.Looper.loop(Looper.java:148)
    2 frames
  8. org.appcelerator.kroll
    KrollRuntime$KrollRuntimeThread.run
    1. org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118)
    1 frame