title: OutOfMemory exception when loading bitmap from external storage
body: <p>In my application I load a couple of images from JPEG and PNG files. When I place all those files into assets directory and load it in this way, everything is ok:</p>
  
  <pre><code>InputStream stream = getAssets().open(path);
  Bitmap bitmap = BitmapFactory.decodeStream(stream, null, null);
  stream.close();
  return new BitmapDrawable(bitmap);
  </code></pre>
  
  <p>But when I try to load the exact same images from sd card, I get an OutOfMemory exception!</p>
  
  <pre><code>InputStream stream = new FileInputStream("/mnt/sdcard/mydata/" + path);
  Bitmap bitmap = BitmapFactory.decodeStream(stream, null, null);
  stream.close();
  return new BitmapDrawable(bitmap);
  </code></pre>
  
  <p>This is what I get in the log:</p>
  
  <pre><code>11-05 00:53:31.003: ERROR/dalvikvm-heap(13183): 827200-byte external allocation too large for this process.
  11-05 00:53:31.003: ERROR/GraphicsJNI(13183): VM won't let us allocate 827200 bytes
  ...
  11-05 00:53:31.053: ERROR/AndroidRuntime(13183): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
  11-05 00:53:31.053: ERROR/AndroidRuntime(13183):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
  ...
  </code></pre>
  
  <p>Why can this happen?</p>
  
  <p>UPDATE: Tried both of these on real device - it seems that I can't load more than 12MB of bitmaps into whatever is called "external memory" (this is not an sd card).</p>