title: a single character in Base64String holds how many bytes? 1, 2 or more
body: <p>In my Android application the requirement is to fetch the images from the server and cache them into the heap memory.</p>
  
  <p>On receiving the request, the server first encodes the <code>byte[]</code> into <code>Base64String</code> and returns that string. And, at the time of rendering it into <code>ImageView</code> the Android application decodes the <code>Base64String</code> back to the <code>byte[]</code>, creates a <code>Bitmap</code>, and puts it on <code>ImageView</code>.</p>
  
  <p>As everything is in cache, there are chances the Application to go out of memory at some point, and crash critically. </p>
  
  <p>To prevent the out of memory situation, I have defined a <strong>safety quantum</strong> (E.g. 5 MB) in my application. If at any point the available memory goes below to this <strong>safety quantum</strong>, user would then need to mark some of the images as the candidates to be deleted. Along with, the application would show the <strong>estimated memory</strong> going to be released once the selected items are cleared.</p>
  
  <p>The <code>Bitmap</code> has been recycled once user moves away from the image, so the <code>Bitmap</code> effectively isn't holding any memory as long as we are away.</p>
  
  <p>In a particular test, I download 55 images, and my heap grows from <code>16 MB</code> to <code>42 MB</code>. That means, 55 images occupy <code>26 MB</code>. After I clear all of them, the heap shrinks back to <code>16 MB</code>. </p>
  
  <p>But, when I take a cumulative sum of lengths of all <code>Base64String</code> it comes to <code>11983840</code>. And if I consider one character as <code>1 byte</code> the <code>11983840 bytes</code> makes <code>11.4 MB</code></p>
  
  <p>The problem is, cumulative sum of the lengths of <code>Base64String</code> is the only measure available to me, that helps to let user know how much memory can be released by his selection.</p>
  
  <p>I have also read the following question, which mentions, for each <code>3 Bytes</code> of original data the <code>Base64String</code> will have <code>4 Characters</code>.</p>
  
  <p><a href="https://stackoverflow.com/questions/13378815/base64-length-calculation">Base64 length calculation?</a></p>
  
  <p>The question is,
  a single character in <code>Base64String</code> holds how many bytes? 1, 2 or more</p>
  
  <p>If <code>1 character</code> is <code>1 byte</code>, 
  and in my test the heap grows and shrinks by <strong>26 MB</strong>. Then why the cumulative sum of the lengths of <code>Base64String</code> is only <strong>11.4 MB</strong>?</p>
  
  <p><strong>Updated</strong></p>
  
  <p><a href="https://i.stack.imgur.com/SOLQW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SOLQW.png" alt="enter image description here"></a></p>
  
  <p>This means <code>1 Byte</code> per character.</p>
  
  <p><a href="https://i.stack.imgur.com/bxOO0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bxOO0.png" alt="enter image description here"></a></p>
  
  <p>The default CharacterSet here is UTF-8</p>