title: memmove resulting in growing heap size and eventual termination
body: <p>I am trying to read and process a binary file. Due to the way its written, I read it in a char array. After I have processed the data. I move the remaining data to the begining of the char buffer to avoid the buffer overflow. I am using memmove for this but this seems to be causing a heap growth which shows my memory utilization increasing until the process is killed. What I was trying to achieve was a circular array so that i don't have to use too much memory.</p>
  
  <pre><code>char readDat[5000000];
  char* readBuf = readDat;
  while(reading file)
  {
       processData(readBuf);
       memmove(readBuf, readBuf + processedSize, totalSize - processedSize);
  }
  </code></pre>
  
  <p>Because of other dependencies I would like to do this using char arrays only rather than using other structures like queue or lists.</p>