title: Mathlink memory usage accumulation
body: <p>I use <code>MathLink</code> to send and receive independent mma expressions from a <code>C++</code> application as strings. </p>
  
  <pre><code>std::string expression[N];
  // ...
  for(int i = 0; i &lt; N; ++i) {
      MLPutFunction(l, "EnterTextPacket", 1);
      MLPutString(l, expression[i].c_str());
      MLEndPacket(l);
  
      // Check Packet ...
  
      const char* result;
      MLGetString(l, &amp;result);
  
      // process result ...
  
      MLDisownString(l, result);
  }
  </code></pre>
  
  <p>I would expect that <code>MLDisownString</code> frees the used memory except that it doesn't.</p>
  
  <p>Any ideas?</p>