title: How to implement a memory heap
body: <p>Wasn't exactly sure how to phrase the title, but the question is:</p>
  
  <p>I've heard of programmers allocating a large section of contiguous memory at the start of a program and then dealing it out as necessary. This is, in contrast to simply going to the OS every time memory is needed.
  I've heard that this would be faster because it would avoid the cost of asking the OS for contiguous blocks of memory constantly.</p>
  
  <p>I believe the JVM does just this, maintaining its own section of memory and then allocating objects from that.</p>
  
  <p>My question is, how would one actually implement this?</p>