安卓的OutOfMemoryError:位图大小超过VM预算 [英] Android OutOfMemoryError : bitmap size exceeds VM budget

查看:106
本文介绍了安卓的OutOfMemoryError:位图大小超过VM预算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临的OutOfMemoryError的问题是位图的大小超过虚拟机的预算,而改变的Droid手机的方向(但不是在任何其他手机一样的Andr​​oid正常和Android小的)。我是显示10张图像中的GridView,每个一个尺寸小于20KB。

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 Android normal and Android small).I am displaying 10 images in gridview, each one size is less than 20kb.

如果我插入2张图片则不会出现该错误。

If i insert 6 images then it doesn't arise that error.

我该如何解决这个问题,任何一个请解决这个问题。 谢谢

How can i resolve this problem, any one please solve this problem. Thanks

推荐答案

确保两件事:
1.确保你不会泄漏内存。更多资讯 http://android-developers.blogspot.com/ 2009/01 /避免内存,leaks.html
2.降低位图的内存。检查是否在选择向下采样位图。这里更多信息<一个href="http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue/823966#823966">http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue/823966#823966.

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 http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue/823966#823966.

检查,以便为处理大型位图和的OutOfMemoryError我相信有很多的讨论,可以帮助你在这里的。

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

这篇关于安卓的OutOfMemoryError:位图大小超过VM预算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆