java.lang.OutOfMemoryError: bitmap size exceeds VM budget 03-19 10:32:54.923: E/TiDrawableReference(3474):

Appcelerator JIRA | Devang Gandhi | 5 years ago
  1. 0

    The app uses camera to click pictures, and upload to their server. Before uploading they perform image compression and resizing. Ti.imagefactory module is used for these purposes. The pictures are high resolution images, taken by a 8MP camera on the Motorola Droid X. The issue arises, when he uploads more than 1 image or multiple similar images or displaying the image in imageview. He gets "Unable to load bitmap.Not enough memory.bitmap size exceeds VM budget." error on the device. You can see the crash log here {code}03-19 10:32:54.837: E/dalvikvm-heap(3474): 5752604-byte external allocation too large for this process. 03-19 10:32:54.916: E/GraphicsJNI(3474): VM won't let us allocate 5752604 bytes 03-19 10:32:54.916: D/dalvikvm(3474): GC_FOR_MALLOC freed 0K, 47% free 9431K/17479K, external 11586K/13634K, paused 73ms 03-19 10:32:54.923: E/TiDrawableReference(3474): (main) [1277,430400] Unable to load bitmap. Not enough memory: bitmap size exceeds VM budget 03-19 10:32:54.923: E/TiDrawableReference(3474): java.lang.OutOfMemoryError: bitmap size exceeds VM budget 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.graphics.Bitmap.nativeCreate(Native Method) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.graphics.Bitmap.createBitmap(Bitmap.java:507) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.graphics.Bitmap.createBitmap(Bitmap.java:474) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:379) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:558) 03-19 10:32:54.923: E/TiDrawableReference(3474): at ti.modules.titanium.ui.widget.TiUIImageView.setImage(TiUIImageView.java:736) 03-19 10:32:54.923: E/TiDrawableReference(3474): at ti.modules.titanium.ui.widget.TiUIImageView.processProperties(TiUIImageView.java:849) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:464) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.proxy.TiViewProxy.handleToImage(TiViewProxy.java:716) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:303) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.os.Handler.dispatchMessage(Handler.java:95) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:318) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:303) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:188) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:215) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:143) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:417) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.TiBaseActivity.onRestart(TiBaseActivity.java:830) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.Instrumentation.callActivityOnRestart(Instrumentation.java:1139) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.Activity.performRestart(Activity.java:3865) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.Activity.performResume(Activity.java:3876) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2191) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2228) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:994) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.os.Handler.dispatchMessage(Handler.java:99) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.os.Looper.loop(Looper.java:123) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.ActivityThread.main(ActivityThread.java:3806) 03-19 10:32:54.923: E/TiDrawableReference(3474): at java.lang.reflect.Method.invokeNative(Native Method) 03-19 10:32:54.923: E/TiDrawableReference(3474): at java.lang.reflect.Method.invoke(Method.java:507) 03-19 10:32:54.923: E/TiDrawableReference(3474): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 03-19 10:32:54.923: E/TiDrawableReference(3474): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 03-19 10:32:54.923: E/TiDrawableReference(3474): at dalvik.system.NativeStart.main(Native Method) 03-19 10:32:54.923: I/TiUIHelper(3474): (main) [8,430408] view does not have parent, calling layout {code} Created sample apps, using the ti.imagefactory module, but could not reproduce this issue. Also tested the code on Motorola Droid3, LG OptimusV but still could not reproduce the issue.

    Appcelerator JIRA | 5 years ago | Devang Gandhi
    java.lang.OutOfMemoryError: bitmap size exceeds VM budget 03-19 10:32:54.923: E/TiDrawableReference(3474):
  2. 0

    The app uses camera to click pictures, and upload to their server. Before uploading they perform image compression and resizing. Ti.imagefactory module is used for these purposes. The pictures are high resolution images, taken by a 8MP camera on the Motorola Droid X. The issue arises, when he uploads more than 1 image or multiple similar images or displaying the image in imageview. He gets "Unable to load bitmap.Not enough memory.bitmap size exceeds VM budget." error on the device. You can see the crash log here {code}03-19 10:32:54.837: E/dalvikvm-heap(3474): 5752604-byte external allocation too large for this process. 03-19 10:32:54.916: E/GraphicsJNI(3474): VM won't let us allocate 5752604 bytes 03-19 10:32:54.916: D/dalvikvm(3474): GC_FOR_MALLOC freed 0K, 47% free 9431K/17479K, external 11586K/13634K, paused 73ms 03-19 10:32:54.923: E/TiDrawableReference(3474): (main) [1277,430400] Unable to load bitmap. Not enough memory: bitmap size exceeds VM budget 03-19 10:32:54.923: E/TiDrawableReference(3474): java.lang.OutOfMemoryError: bitmap size exceeds VM budget 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.graphics.Bitmap.nativeCreate(Native Method) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.graphics.Bitmap.createBitmap(Bitmap.java:507) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.graphics.Bitmap.createBitmap(Bitmap.java:474) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:379) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:558) 03-19 10:32:54.923: E/TiDrawableReference(3474): at ti.modules.titanium.ui.widget.TiUIImageView.setImage(TiUIImageView.java:736) 03-19 10:32:54.923: E/TiDrawableReference(3474): at ti.modules.titanium.ui.widget.TiUIImageView.processProperties(TiUIImageView.java:849) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:464) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.proxy.TiViewProxy.handleToImage(TiViewProxy.java:716) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:303) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.os.Handler.dispatchMessage(Handler.java:95) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:318) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:303) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:188) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:215) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:143) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:417) 03-19 10:32:54.923: E/TiDrawableReference(3474): at org.appcelerator.titanium.TiBaseActivity.onRestart(TiBaseActivity.java:830) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.Instrumentation.callActivityOnRestart(Instrumentation.java:1139) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.Activity.performRestart(Activity.java:3865) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.Activity.performResume(Activity.java:3876) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2191) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2228) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:994) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.os.Handler.dispatchMessage(Handler.java:99) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.os.Looper.loop(Looper.java:123) 03-19 10:32:54.923: E/TiDrawableReference(3474): at android.app.ActivityThread.main(ActivityThread.java:3806) 03-19 10:32:54.923: E/TiDrawableReference(3474): at java.lang.reflect.Method.invokeNative(Native Method) 03-19 10:32:54.923: E/TiDrawableReference(3474): at java.lang.reflect.Method.invoke(Method.java:507) 03-19 10:32:54.923: E/TiDrawableReference(3474): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 03-19 10:32:54.923: E/TiDrawableReference(3474): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 03-19 10:32:54.923: E/TiDrawableReference(3474): at dalvik.system.NativeStart.main(Native Method) 03-19 10:32:54.923: I/TiUIHelper(3474): (main) [8,430408] view does not have parent, calling layout {code} Created sample apps, using the ti.imagefactory module, but could not reproduce this issue. Also tested the code on Motorola Droid3, LG OptimusV but still could not reproduce the issue.

    Appcelerator JIRA | 5 years ago | Devang Gandhi
    java.lang.OutOfMemoryError: bitmap size exceeds VM budget 03-19 10:32:54.923: E/TiDrawableReference(3474):
  3. 0

    Out Of Memory Error Since hellocharts used

    GitHub | 2 years ago | sol4ris2048
    java.lang.OutOfMemoryError
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    slow loading, drawing on big picture

    Stack Overflow | 3 years ago | Papi
    java.lang.OutOfMemoryError
  6. 0

    [android-developers] Strange out of memory issue on Nexus One

    Google Groups | 6 years ago | Alex Xin
    java.lang.OutOfMemoryError: bitmap size exceeds VM budget

    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

      bitmap size exceeds VM budget 03-19 10:32:54.923: E/TiDrawableReference(3474):

      at android.graphics.Bitmap.nativeCreate()
    2. Android Platform
      Bitmap.nativeCreate
      1. android.graphics.Bitmap.nativeCreate(Native Method)
      1 frame