title: Understanding Memory Pools
body: <p>To my understanding, a memory pool is a block, or multiple blocks of memory allocate on the stack before runtime.<br>
  By contrast, to my understanding, dynamic memory is requested from the operating system and then allocated on the heap during run time.  </p>
  
  <p><strong>// EDIT //</strong>  </p>
  
  <ul>
  <li><strong>Memory pools are evidently <em>not necessarily</em> allocated on the stack ie. a memory pool can be used with dynamic memory.</strong>  </li>
  <li><strong>Non dynamic memory is evidently <em>also</em> not necessarily allocated on the stack, as per the answer to this question.</strong></li>
  <li><strong>The topics of <em>'dynamic vs. static memory'</em> and <em>'memory pools'</em> are thus not really related although the answer is still relevant.</strong> </li>
  </ul>
  
  <p>From what I can tell, the purpose of a memory pool is to provide manual management of RAM, where the memory must be tracked and reused by the programmer.  </p>
  
  <p>This is theoretically advantageous for performance for a number of reasons:   </p>
  
  <ol>
  <li>Dynamic memory becomes fragmented over time  </li>
  <li>The CPU can parse static blocks of memory faster than dynamic blocks  </li>
  <li>When the programmer has control over memory, they can choose to free and rebuild data when it is best to do so, according the the specific program.  </li>
  </ol>
  
  <p>
  4. When multithreading, separate pools allow separate threads to operate independently without waiting for the shared heap (Davislor)</p>
  
  <p>Is my understanding of memory pools correct? If so, why does it seem like memory pools are not used very often?  </p>