Search code examples
androidbitmaprecycle

Android bitmap size exceeds VM budget error


Android bitmap size exceeds VM budget.

My app is getting this error frequently. I have two questions.

  1. Do I need to recycle my about activity (it contains some imageviews and buttons and textViews)?
  2. What is the difference between .recycle(); and between system.gc(); ?

Solution

  • You should always try and recycle Bitmaps afte you have used them.

    As far as I understand, you should try and avoid calling system.gc(). Calling recycle() will allow the bitmap object to be garbage collected.

    I hope this helps.