安卓的OutOfMemoryError:位图大小超过VM预算位图、预算、大小、OutOfMemoryError

由网友(丨极速灬巅峰彡丨)分享简介:我面临的OutOfMemoryError的问题是位图的大小超过虚拟机的预算,而改变的Droid手机的方向(但不是在任何其他手机一样的Andr​​oid正常和Android小的)。我是显示10张图像中的GridView,每个一个尺寸小于20KB。 i am facing a problem of OutOfMemory...

我面临的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.降低位图的内存。检查是否在选择向下采样位图。这里更多信息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.

阅读全文

相关推荐

最新文章