title: Open GL ES memory management
body: <p>I'm working on an Android app using Open GL ES 2.0. I'm confused about memory management in Open GL.</p>
  
  <p>My questions are:</p>
  
  <ul>
  <li>How much memory is available to the Open GL hardware? Clearly it's going to vary from device to device.</li>
  <li>How can I find out how much memory is in use and how
  much is left?</li>
  <li>What happens if I exceed the memory limits?</li>
  <li>What techniques should I be using to unload data not currently being displayed?</li>
  </ul>
  
  <p>I presume I'm going to have to implement some kind of system to unload textures that are not currently in use on an LRU basis, but I'd like some idea of what criteria to use  for this.
  The app silently dies at some point and I suspect it is because I'm using too much graphics memory.</p>
  
  <p>Currently I'm never unloading textures and I seem to be able to load quite a few - testing on a Nexus 7 I have been able to load 134 1024x1024 RGBA textures, which I calculate to be over 500MB. I presume once the textures have been loaded into graphics memory they take up less space, but that's still a lot, and clearly I have to manage that but I'd like some tips on how to start.</p>