title: How to release the actual Activity object memory after quitting out of the activity?
body: <p>I'm getting an OutofMemoryError for my android application, and am a bit confused as to whats going on. Basically what happens is, I'm able to run it the first few times, but when I try to quit out of it and then open it again quickly and repetitively, I get an out of memory error.</p>
  
  <p>I've tried researching this topic, and have found that the recycle() method has commonly been the problem. However, I've called the recycle method on each of the bitmaps (which are stored in an object container, stored in an arraylist), but was still getting the problem. </p>
  
  <p>After doing this, I tried using the Eclipse Memory Analyzer to look at heap dumps, when I came across something weird. After quitting out of the activity (back into the launcher activity, and then opening up the activity again via a button, I took screenshots of the heap dump using the memory analyzer. It turns out, with each time I quit and re-entered the activity, another instance of the activity object was being created, and the old ones weren't being released, even though the onDestroy() method was being called (which also had the recycle/cleanup code. </p>
  
  <p>I then tried overriding the finalize method to see if it was being called when the activity quit out back into the launcher activity, but it wasn't being called. I read on some other stackoverflow threads that finalize() isn't always called, so in the end, I'm still not sure whats going on.</p>
  
  <p><strong>Ultimately, my question is this:</strong>
  How am I supposed to ensure that the Activity object (the activity object itself, not the stuff created from the activity) is released after quitting out from the activity into another activity?</p>