I am working at a program that sends/receives files over the network using the `TCP`. 
The program sends multiple files, so the stream is not close until the user quits the program.

The problem that i am facing is that, when i am sending a 700mb file, my server program private memory grows to 700,000 K and cripples my computer performance badly. And when trying to send another 700mb file the server throws an `System.OutOfMemoryException`.

Can someone tell me what i am doing wrong, or not doing ?

Server-side code:

```
   using (   FileStream fs = new FileStream("dracula.avi", FileMode.Open, FileAccess.Read))                            
  {                                                        
   byte[] data = new byte[fs.Length];
   int remaining = data.Length;
   int offset = 0;

   strWriter.WriteLine("Content-Length: " + data.Length);
   strWriter.Flush();

   Thread.Sleep(1000);
   while (remaining > 0)
        {
            Thread.Sleep(10);
            int read = fs.Read(data, offset, remaining);
            remaining -= read;
            offset += read;

        }

   fs.Flush();
   fs.Close();
 }   

  strm.Write(data, 0, data.Length);
  strm.Flush();
  GC.Collect();

```