title: Why is the MemoryStream data not released from memory
body: <p>Is there something that needs to be done with the following code to release the memory it uses?</p>
  
  <pre><code>  Dim objImage As MemoryStream
    Dim objwebClient As WebClient
    Dim sURL As String = Trim(m_StationInterface.PicLocation)
  
    objwebClient = New WebClient
    objImage = New MemoryStream(objwebClient.DownloadData(sURL))
    m_imgLiftingEye.Image = Image.FromStream(objImage)
  </code></pre>
  
  <p>The code is on a popup form that shouldn't ever get disposed. A new image is loaded onto the form every time it pops up. However, the process size for the application continues to grow each time it makes it through that code block.</p>
  
  <p>I've tried objImage.Close() and .Flush(), objWebClient.Dispose(). The process size still grows by a good 4mb after every call. It's like the old image is kept in memory.</p>