Memory issues loading images for app
<p>Describing background, as I may just have a terrible approach to the problem - self learning.</p>

<p>I'm writing an app for android, and testing it on default AVD, which is set to WVGA800 with 512 'device ram size' and 240  'Abstracted LCD density'.</p>

<p>I have some images, and I put them into drawable-hdpi.
There are 458 KB (not MB) worth of images in that folder.
All images are in PNG format.</p>

<p>The issue is that when I try to load my biggest image (used for background), it throws: <code>java.lang.OutOfMemoryError</code>
This is the call to load the image: </p>

<pre><code>BitmapFactory.decodeResource(status.getResources(), R.drawable.background);
</code></pre>

<p>This is identical to how I load the rest of images (33 in total).</p>

<p>It makes sense to me, that it would run out of memory on biggest image, but my total size of folder is 458 KB, so I wouldn't expect to run out of 512 MB Ram set on device.</p>

<p>I never unload any images, I keep them loaded, and use as needed.
I wrote a different app before, where my total size of images was 563 KB with 82 images total, and I didn't have this issue (using the same AVD).  In fact the prior app used to make a couple of copies of each image by flipping it, and still didn't run out of space.  Current app is failing on initial load - before much happened.</p>

<p>Could someone point me at what the issue could possibly be?  And how I can solve it, or maybe mention if my approach is wrong (self-teaching myself from examples)</p>
