title: How to measure the memory usage of std::unordered_map
body: <p>We know that hash table based container implementations like <a href="https://stackoverflow.com/questions/9375450/stdunordered-map-very-high-memory-usage"><code>std::unordered_map</code> use a lot memory</a> but I don't know how much is how much?</p>
  
  <p>Apart from space complexity notations, and not considering if a container element is a pointer to a larger object:</p>
  
  <p>Is there any way to figure out how many <em>bytes</em> is being used by such a container during run-time?</p>
  
  <p>Is there a way to tell, at runtime, how much memory <em>any</em> container uses?</p>