problems with bitmaps

All your problems with Audio, Video and Images.

problems with bitmaps

Postby JJ » Thu Apr 09, 2009 10:01 pm

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
JJ
Developer
Developer
 
Posts: 35
Joined: Tue May 13, 2008 1:18 pm

Top

Postby stifry » Mon Apr 13, 2009 5:01 pm

Are you using bitmap recycle()? Try calling that on a bitmap when you're finished with it. That will help free up some memory.
Visit Trackaroo.com!
Trackmaster - Motorsports Lap Timer
Dynomaster - Performance Dyno
Image Image
User avatar
stifry
Developer
Developer
 
Posts: 46
Joined: Tue Feb 17, 2009 7:50 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests