If you are working with a VSTO or managed code solution for Office, you may encounter a System.OutOfMemoryException when working with very large DataSets, XML files, or numerious object serialization calls. The problem typically occurs on a call to System.String.GetStringForStringBuilder in the managed call stack.

For details on the problem and its general cause, see the following post:
Problems with System.OutOfMemoryException At System.String.GetStringForStringBuilder in 32-Bit Managed Solutions