title: Optimising memory usage for Android
body: <pre><code>02-08 12:18:11.294: E/AndroidRuntime(25243): java.lang.OutOfMemoryError: (Heap Size=36771KB, Allocated=7320KB)
  </code></pre>
  
  <p>How do i optimise the usage of memory? More often than not, I'm encountering the above problem. </p>
  
  <p>1) How do i clear imageAdapter, gridview, imageview and anything that deals with large data in fragments if i need to do addToBackStack. For fragment, replace was use to transit pages.</p>
  
  <p>2) Is there any other ways to allow back button click to previous page (fragments) while clearing everything on the fragment page when transiting to next page? </p>