title: HTTPClient Memory Issue
body: <p>I'm having some issues using the HttpClient class. When making multiple requests, my program's memory usage slowly creeps up. That wouldn't necessarily be an issue, but the problem is that when the process is done, the memory stays up there. Take this block of code:</p>
  
  <pre><code>HttpClient client = new HttpClient();
  for (int i = 0; i &lt; 100; i++)
  {
      HttpResponseMessage response = client.GetAsync("http://localhost").Result;
      string responseString = response.Content.ReadAsStringAsync().Result;
  }
  </code></pre>
  
  <p>When running that bit of code, my program's memory creeps up from ~9MB to about 16MB, drops down to ~14.8MB, and then stays there. I feel like it's worth mentioning that the return result is ~50 bytes, so even if these 100 response strings were being kept in memory that doesn't account for the 6MB.</p>
  
  <p>This becomes a huge issue when I'm executing thousands of requests - a 20,000 request set will leave my program consuming 600-700MB after the requests have all completed and the proper data has been exported and cleared.</p>
  
  <p>I've looked through the heap with VS2015's diagnostic tools, and have found that the biggest offender is a List of PinnableBufferCaches. _SslStreams also make up quite a bit.</p>
  
  <p>Why is this memory never freed? Even with such basic use of the HttpClient class, this issue can become debilitating. I can't seem to find any reasoning online, and feel like I'm just not looking for the right thing.</p>
  
  <p>Edit: Even when calling Dispose on the client, or using a 'using' statement (see MickyD's answer below), the memory issue is exactly the same.</p>