title: Hash Map Memory Overhead
body: <p>I was studying about internal structure of Hash Map where i came across following details:</p>
  
  <ul>
  <li><p>Implementation is an array of HashMap$Entry objects:</p></li>
  <li><p>Each HashMap$Entry contains: 
     – int KeyHash 
     – Object next
     – Object key
     – Object Value</p></li>
  <li><p>Default capacity is 16 entries</p></li>
  <li><p>Empty size is 128 bytes</p></li>
  <li><p>Overhead is 48 bytes for HashMap, plus (16 + (entries * 4bytes)) for 
  array – Plus overhead of HashMap$Entry objects</p></li>
  <li><p>Additional 32bytes per key ↔ value entry Overhead of HashMap is<br>
  therefore: – 48 bytes, plus 36 bytes per entry</p></li>
  </ul>
  
  <p>Can anyone please explain me <strong>"Overhead is 48 bytes for HashMap, plus (16 + (entries * 4bytes)) for 
     array"</strong>    and <strong>"Additional 32bytes per key ↔ value entry Overhead of HashMap is<br>
     therefore: – 48 bytes, plus 36 bytes per entry"</strong>     ???</p>
  
  <p>I can't understand how these conclusions came i.e. how we came across this final memory details about hash map.</p>