title: java.lang.OutOfMemoryError: bitmap size exceeds VM budget - Android
body: <p>I developed an application that uses lots of images on Android.</p>
  
  <p>The app runs once, fills the information on the screen (<code>Layouts</code>, <code>Listviews</code>, <code>Textviews</code>, <code>ImageViews</code>, etc) and user reads the information.</p>
  
  <p>There is no animation, no special effects or anything that can fill the memory.
  Sometimes the drawables can change. Some are android resources and some are files saved in a folder in the SDCARD.</p>
  
  <p>Then the user quits (the <code>onDestroy</code> method is executed and app stays in memory by the VM ) and then at some point the user enters again. </p>
  
  <p>Each time the user enters to the app, I can see the memory growing more and more until user gets the <code>java.lang.OutOfMemoryError</code>.</p>
  
  <p>So what is the best/correct way to handle many images?</p>
  
  <p>Should I put them in static methods so they are not loaded all the time?
  Do I have to clean the layout or the images used in the layout in a special way?</p>