title: StringBuilder.ToString() throws OutOfMemoryException
body: <p>I have a created a <code>StringBuilder</code> of length "132370292", when I try to get the string using the <code>ToString()</code> method it throws <code>OutOfMemoryException</code>.</p>
  
  <pre><code>StringBuilder SB = new StringBuilder();
  
  for(int i =0; i&lt;=5000; i++)
  {
      SB.Append("Some Junk Data for testing. My Actual Data is created from different sources by Appending to the String Builder.");
  }
  
  try
  {
      string str = SB.ToString(); // Throws OOM mostly
      Console.WriteLine("String Created Successfully");
  }
  catch(OutOfMemoryException ex)
  {
      StreamWriter sw = new StreamWriter(@"c:\memo.txt", true);
      sw.Write(SB.ToString()); //Always writes to the file without any error
      Console.WriteLine("Written to File Successfully");
  }
  </code></pre>
  
  <p>What is the reason for the OOM while creating a new string and why it doesn't throw OOM while writing to a file?</p>
  
  <p>Machine Details: 64-bit, Windows-7, 2GB RAM, .NET version 2.0</p>