title: bitmap size exceeds VM budget when images are loading from base64 content
body: <p>I am getting images from my back end in base 64 format, decoding it and loading the images in a grid view. It works fine for the first time but when I click the "show more images" button it gives me the error <strong>bitmap size exceeds VM budget</strong>. When i click on that button I get images in base64 format and I set the adapter of the grid view again in order to refresh the view. I read many of the answers related to this problem but all of them are reading images from drawables and not receiving in base64 format. My code to get the images decoded from base64 to bitmap is as follows:</p>
  
  <pre><code>public static void getImages(JSONObject jobj){
      try{
          JSONArray jarr = jobj.getJSONArray("images");
          Log.v("array size",""+jarr.length());
          for(int i = 0; i &lt; jarr.length(); i++){
              String encodedContent = jarr.get(i).toString();
              byte[] decodedContent = Base64.decode(encodedContent);
              Bitmap bmp = BitmapFactory.decodeByteArray(decodedContent, 0, decodedContent.length);
              images.add(bmp); //Static array list to save the bitmap images
          }
      }catch(JSONException e){
          e.getMessage();
      }
  </code></pre>
  
  <p>Next time the images come in after clicking the "show more images" button it gets added to that images arraylist. Can anyone help me on suggesting how can I remove this error I am getting?</p>