BitmapFactory does not leak. It throws an OutOfMemoryException when
there's no more memory available. That's all.

On Thu, Apr 9, 2009 at 4:36 PM,  <mark.ka...@gmail.com> wrote:
>
>
>  There's been a number of threads on this issue, the BitmapFactory
> tends to throw this out of memory errors when it really shouldn't,
> looks like a bug or memory leak. I'm not sure if it's cataloged as an
> official bug though. Using bitmap.recycle(), and reducing the sample
> size will mitigate , but not eliminate the problem. Also try reducing
> the memory footprint of your images if possible. Hopefully this will
> be recognized as a bug and fixed in a future release, at least I hope
> so, I've had similar problems myself, and so have a number of other
> developers.
>
>                                            M
>
> On Apr 9, 1:57 pm, petunio <juanjosegilmen...@hotmail.com> wrote:
>> Hi everybody
>>
>> I am having a problem with the BitmapFactory:
>>
>> this is my function, that reads a stream, and returns a bitmap:
>>
>>         static Bitmap getBitmap(InputStream is) throws IOException
>>         {
>>            Bitmap bmp=null;
>>
>>           //do some stuff...
>>
>>            bmp=BitmapFactory.decodeStream(is);
>>
>>            return bmp;
>>         }
>>
>> after calling it a few times, it crashes giving me the following
>> error:
>>
>> ERROR/(1329): VM won't let us allocate 215488 bytes
>> ERROR/AndroidRuntime(1329): java.lang.OutOfMemoryError: bitmap size
>> exceeds VM budget
>>
>> I am counting the memory used so far, and it's only 395328 bytes, so I
>> am sure there must be something else...
>>
>> any ideas?
>>
>> Thanks
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to