title: Android LruCache cache size parameter
body: <p>I am trying to follow a 2 year old tutorial on android regarding the usage of LruCache and some samples I have googled so far have the same method which is to pass an value(int) that is converted to KiB.</p>
  
  <pre><code>final int maxMemory = (int)(Runtime.getRuntime().maxMemory() / 1024); 
  final int cacheSize = maxMemory / 8; //use 1/8th of what is available
  imageCache = new LruCache&lt;&gt;(cacheSize);
  </code></pre>
  
  <p>However as taken from Google's documentation, the passed int value seems to be converted to bytes (from MiB):
  <a href="https://developer.android.com/reference/android/util/LruCache.html" rel="noreferrer">https://developer.android.com/reference/android/util/LruCache.html</a></p>
  
  <pre><code>int cacheSize = 4 * 1024 * 1024; // 4MiB
  LruCache&lt;String, Bitmap&gt; bitmapCache = new LruCache&lt;String, Bitmap&gt;(cacheSize) {
     protected int sizeOf(String key, Bitmap value) {
         return value.getByteCount();
     }
  }
  </code></pre>
  
  <p>I would like to know which one is the correct unit of measurement.
  Any answers would be greatly appreciated..</p>