Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well. Bitmaps on Android can be a little tricky. Can you give better information about the sources of the bitmaps and their sizes? </p> <p>Otherwise, I'd recommend looking into these things:</p> <ol> <li><p>If you're loading remote images, check out <a href="https://github.com/facebook/fresco" rel="nofollow">fresco</a>. You can also check out <a href="http://square.github.io/picasso/" rel="nofollow">Picasso</a>. I personally used to like <a href="https://github.com/nostra13/Android-Universal-Image-Loader" rel="nofollow">ImageLoader</a>, but it is not being maintained anymore.</p></li> <li><p>If you're using the inPurgable flag that used to be a recommended option, try to find a way around it as it actually causes more memory to be allocated for each image. </p></li> <li><p>If you decode small, local assets frequently, consider saving your drawables in a hashmap and reusing them when needed. Less GC. </p></li> <li><p>If you care to subclass your Application, you can use the <a href="http://developer.android.com/reference/android/app/Application.html#onLowMemory%28%29" rel="nofollow">OnLowMemory</a> call to know when you probably <em>really</em> need to clean up (mostly good for debugging, not real life situations) ... If that's not too late... :)</p></li> <li><p>Take a look at Chris Banes' blog. <a href="http://www.senab.co.uk/2013/01/24/android-bitmapcache-v2-1/" rel="nofollow">This</a> is a pretty interesting memory cache solution</p></li> <li><p>Implement a memory trimmer you call whenever needed and possible.</p></li> <li><p>One other unsurprising optimization is to use smaller objects when you can... Think of your minimal data models and image sizes and try to have a conforming API for those.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload