title: OutOfMemoryError: Failed to allocate a 82956 byte allocation with 30836 free bytes and 30KB until OOM?
body: <p>in my application i have a database where i store images but when i try to retrieve image in BitMap logcat shows OutOfMemoryError .this error does't appear when i retrieve only one image from the database(when i don't use do while loop my code is runing good ).please help i'm new in android.</p>
  
  <p>this class try to retrieve images from db:</p>
  
  <pre><code>class Abc {
  
      ArrayList &lt; ForBitMap &gt; pic;
  
      Abc() {
  
          pic = new Abc &lt; &gt; ();
  
          DataBaseClass objOfDataBaseClass = new DataBaseClass(context);
          mCursor = objOfDataBaseClass.showData();
  
          if (mCursor.moveToNext()) {
  
              do {
  
                  byte[] mg = null;
  
                  mg = mCursor.getBlob(mCursor.getColumnIndex("image"));
                  Bitmap bitmap = BitmapFactory.decodeByteArray(mg, 0, mg.length);
  
                  pic.add(new ForBitMap(bitmap));
  
              } while (mCursor.moveToFirst());
  
          }
      } 
  </code></pre>
  
  <p>this class use for store the value in ArrayList(ArrayList pic;)</p>
  
  <pre><code>class ForBitMap{
      Bitmap btmp;
  
      ForBitMap(Bitmap btmp){
          this.btmp=btmp;
      }
  
  }
  </code></pre>
  
  <p>logat status is:</p>
  
  <pre><code>java.lang.OutOfMemoryError: Failed to allocate a 82956 byte allocation with 30836 free bytes and 30KB until OOM
  </code></pre>