【问题标题】:how to fix error in bitmap size exceeds VM budget如何修复位图大小超出 VM 预算的错误
【发布时间】:2011-06-07 02:48:29
【问题描述】:

我正在将一个应用程序图像上传到 sdcard 我正在缩放保存到数据库中的 sdcard 有时会发生一个错误位图大小超出 vm 预算

ouput :

01-11 15:39:51.809: ERROR/AndroidRuntime(6214): Uncaught handler: thread main exiting due to uncaught exception
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:384)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:397)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at com.fitzgeraldsoftware.shout.presentationLayer.Shout.onActivityResult(Shout.java:1653)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.Activity.dispatchActivityResult(Activity.java:3624)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3220)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3266)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.ActivityThread.access$2600(ActivityThread.java:116)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.os.Looper.loop(Looper.java:123)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.ActivityThread.main(ActivityThread.java:4203)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at java.lang.reflect.Method.invokeNative(Native Method)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at java.lang.reflect.Method.invoke(Method.java:521)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at dalvik.system.NativeStart.main(Native Method)

如何解决错误,请提前提供一些解决方案,谢谢

【问题讨论】:

    标签: android exception bitmap size out-of-memory


    【解决方案1】:

    您有内存泄漏。你需要调查才能找到它。这可能是未发布的位图或光标...

    Inspect the heap 看看你有什么样的对象。

    【讨论】:

    • 确保你缓存它们或者你打电话给.release()
    【解决方案2】:

    narasimha,我想这篇文章可能会对你有所帮助

    android-strange-out-of-memory-issue

    或者这个 java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android

    或者可能是这个 android-java-lang-outofmemoryerror

    & 还有更多问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-19
      • 2012-08-09
      • 2012-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多