Android OutOfMemoryError : bitmap size exceeds VM budget

前端 未结 2 783
日久生厌
日久生厌 2021-01-16 01:57

i am facing a problem of OutOfMemoryError that is bitmap size exceeds vm budget while changing the orientation of the Droid mobile (but not in any of other mobiles like Andr

相关标签:
2条回答
  • 2021-01-16 02:35

    Ensure two things:
    1. Make sure you are not leaking memory. More info here http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html
    2. Reduce the Bitmap memory. Check if downsampling Bitmaps in an option. More info here Strange out of memory issue while loading an image to a Bitmap object.

    Check SO for "Handling large Bitmaps" and "OutOfMemoryError" I am sure that are plenty of discussions that can help you here.

    0 讨论(0)
  • 2021-01-16 02:37

    Just to toss in some info here, I had this exact problem (for me I found out it was the .jpg image I was using for my background).

    Well I changed the image from .jpg to .png (and even resized the image a little smaller).

    I think that it was the formatting of the .jpg that was giving me the error, simply changing to .png fixed the error for me.

    0 讨论(0)
提交回复
热议问题