.net 中的bug:System.OutOfMemoryException At System.String.GetStringForStringBuilder

来源:互联网 发布:网络推广赚什么 编辑:程序博客网 时间:2024/05/21 11:26

当用WebService返回大数据时,会出现如下错误:

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)
at System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength)
at System.Text.StringBuilder.Append(String value)
……

 

是由于StringBuilder 中内存不足,可看MSDN上的说明

http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/10/10/stringbuilder-outofmemoryexception.aspx

原创粉丝点击