I read something about releasing memory in android, but I'm still confused about the behavior. In my case I test a simple application, when memory will be allocated and when it will be released. I have two activities. In MainActivity I have an ImageView. I reference a drawable image via `getResources().getDrawable(int id)` or via `BitmapFactory.decodeResource(Resources res, int id)`. Both ways are allocating memory for the image for sure, but this memory will not be released, even if I destroy my activity, recycle the bitmap or setting all variables null.

```java
public class MainActivity extends Activity {

private ImageView view;
private Drawable drawable;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    view = (ImageView) findViewById(R.id.image);
    // tried with BitmapFactory.decode...
    drawable = getResources().getDrawable(R.drawable.connect);
    view.setImageDrawable(dr);

    Button button = (Button) findViewById(R.id.button1);
    button.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = new Intent(getApplicationContext(),
                    SecondActivity.class);
            startActivity(intent);
            // tried with and without finish
            finish();
        }
    });
}

@Override
protected void onResume() {
    super.onResume();

    Double allocated = new Double(Debug.getNativeHeapAllocatedSize())
            / new Double((1048576));
    Double available = new Double(Debug.getNativeHeapSize()) / 1048576.0;
    Double free = new Double(Debug.getNativeHeapFreeSize()) / 1048576.0;
    DecimalFormat df = new DecimalFormat();
    df.setMaximumFractionDigits(2);
    df.setMinimumFractionDigits(2);

    System.out.println("SYSO : " + df.format(allocated) + "MB of "
            + df.format(available) + "MB (" + df.format(free) + "MB free)");
    System.out.println("SYSO : "
            + df.format(new Double(
                    Runtime.getRuntime().totalMemory() / 1048576))
            + "MB of "
            + df.format(new Double(
                    Runtime.getRuntime().maxMemory() / 1048576))
            + "MB ("
            + df.format(new Double(
                    Runtime.getRuntime().freeMemory() / 1048576))
            + "MB free)");
}

@Override
protected void onDestroy() {
    super.onDestroy();
    // tried using BitmapFactory and bitmap.recycle()
    dr.setCallback(null);
    dr = null;
    view = null;
    System.gc();
    Runtime.getRuntime().gc();
}
}

```

I log the memory in my second activity, too. I found out, that my application has about 8-9MB runtime memory on start. Allocating my image in the main view, let the memory grow up to about 20MB. When I'm leaving my activity with `finish()` and using all the releasing stuff like setting callback null and recycling images, why is the memory in the second activity still allocated? I'm resuming the second activity several times and the memory is still allocated. My first activity was destroyed, how can I release its memory? I tested the behavior without setting `callback = null` or recycling bitmap and finishing the `MainActivity`. Then every time I resume the `MainActivity`, the memory grows up about 10MB per resume. Sounds OK, because the old references are not destroyed and every time a new image will be allocated. But why will this initial memory for the first image not be destroyed?