title: System.OutofMemoryException throw while doing GZipStream Compression
body: <p>I am working in win forms. Getting errors while doing following operation.
  It shows me <code>System.OutOfMemoryException</code> error when i try to run the operation around 2-3 times continuously. Seems .NET is not able to free the resouces used in operation. The file i am using for operation is quite big,  around <strong>more than 500 MB.</strong></p>
  
  <p>My sample code is as below. Please help me how to resolve the error.</p>
  
  <pre><code>try
  {
     using (FileStream target = new FileStream(strCompressedFileName, FileMode.Create, FileAccess.Write))
     using (GZipStream alg = new GZipStream(target, CompressionMode.Compress))
     {
         byte[] data = File.ReadAllBytes(strFileToBeCompressed);
         alg.Write(data, 0, data.Length);
         alg.Flush();
         data = null;
      }
  }
  catch (Exception ex)
  {
      MessageBox.Show(ex.ToString());
  }
  </code></pre>