title: C++ allocates abnormally large amout memory for variables
body: <p>I recently got to know an integer takes 4 bytes from the memory.  </p>
  
  <p>First ran this code, and measured the memory usage:</p>
  
  <pre><code>int main()
  {
     int *pointer;
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/SlTT2.jpg" alt="enter image description here"></p>
  
  <ul>
  <li><strong>It took 144KB.</strong></li>
  </ul>
  
  <p>Then I modified the code to allocate <strong>1000 integer variables</strong>.</p>
  
  <pre><code>int main()
  {
     int *pointer;
  
     for (int n=0; n &lt; 1000; n++)
       { 
         pointer = new int ; 
       }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/We470.jpg" alt="enter image description here"></p>
  
  <ul>
  <li><strong>Then it took (168-144=) 24KB</strong><br>
  <strong><em>but 1000 integers are suppose to occupy (4bytes x 1000=) 3.9KB</em>.</strong></li>
  </ul>
  
  <p>Then I decided to make <strong>262,144 integer variables which should consume 1MB of memory</strong>.</p>
  
  <pre><code>int main()
  {
     int *pointer;
  
     for (int n=0; n &lt; 262144; n++)
       { 
         pointer = new int ; 
       }
  }
  </code></pre>
  
  <p><strong>Surprisingly, now it takes 8MB</strong></p>
  
  <p><img src="https://i.stack.imgur.com/LH3eH.jpg" alt="enter image description here"></p>
  
  <p>Memory usage, exponentially grows respective to the number of integers.<br>
  Why is this happening?</p>
  
  <p><strong>I'm on Kubuntu 13.04 (amd64)</strong><br>
  Please give me a little explanation.
  Thanks!</p>
  
  <p>NOTE: <code>sizeof(integer)</code> returns <code>4</code> </p>