title: What is a good memory management strategy for precaching unbounded data set in Android?
body: <p>I am working on an Android app that deals with an arbitrary number of user-defined Views.  The Views can be very simple and lightweight, or they can be very complex and take a relatively long time to instantiate.</p>
  
  <p>I want to use a background thread to precache some of these Views to improve responsiveness when the user switches from one View to the other.  I have a way to set priorities for each View to determine the order they should be added to the cache or removed from cache.</p>
  
  <p>My problem is that I need to determine when I'm running low on memory.  I think I can use <code>MemoryInfo</code> to determine how much memory I have available.  But is there a good rule of thumb for setting thresholds?  At what point should I stop caching additional Views?  At what point should I consider removing lower-priority Views from the cache?</p>