且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android的 - BitmapFactory.de codeByteArray - OutOfMemoryError异常(OOM)

更新时间:2023-02-09 09:08:25

我遇到了这样的问题,在过去。 Android使用位图虚拟机,​​这是非常小的。请确保您通过bmp.recycle处理位图。 Android的后续版本有更多的位图的VM,但我一直在处理这个版本有20MB的限制。

I have run into problems like this in the past. Android uses Bitmap VM and it is very small. Make sure you dispose your bitmap via bmp.recycle. Later versions of Android have more Bitmap VM but the version that I've been dealing with has a 20MB limit.