title: Getting grow heap when using BitmapFactory.decodeResource
body: <p>I get the following warning:</p>
  
  <pre><code>Grow heap (frag case) to 15.723MB for 2073616-byte allocation
  </code></pre>
  
  <p>I am using this function (see below) to save a drawable to a file.</p>
  
  <p>Is there a better way to save the image?</p>
  
  <pre><code>public void save(int resId) {
      BitmapFactory.Options options = new BitmapFactory.Options();
      options.inSampleSize = IMAGE_IN_SAMPLE_SIZE;
      options.inScaled = false;
      options.inJustDecodeBounds = false;
  
      Bitmap bitmapImage = BitmapFactory.decodeResource(context.getResources(), resId, options);
  
      FileOutputStream fileOutputStream = null;
      try {
          fileOutputStream = new FileOutputStream(createFile());
          bitmapImage.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream);
      } catch (Exception e) {
          e.printStackTrace();
      } finally {
          try {
              if (fileOutputStream != null) {
                  fileOutputStream.close();
              }
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>