小编Abh*_*dav的帖子

即使有 30 GB 内存可用,也会出现内存不足异常

我有一个程序(x64)消耗大量内存。我正在运行win server 2008 R2 SP148 GB RAM(64 bit).net frame work 4.5.

我也在gcAllowVeryLargeObjects = trueapp.config中设置了。

当我运行该程序时,它消耗了 18 GB 内存,之后出现异常

EXCEPTION: System.OutOfMemoryException: Insufficient memory to continue the execution of the program.

   at System.Text.StringBuilder.ExpandByABlock(Int32 minBlockCharCount)
   at System.Text.StringBuilder.Append(Char* value, Int32 valueCount)
   at System.Text.StringBuilder.Append(String value)
   at System.Xml.XmlTextEncoder.Write(String text)
   at System.Xml.XmlTextWriter.WriteWhitespace(String ws)
   at System.Xml.XmlElement.WriteElementTo(XmlWriter writer, XmlElement e)
   at System.Xml.XmlNode.get_OuterXml()
   at System.Security.Cryptography.Xml.Utils.PreProcessElementInput(XmlElement e
   lem, XmlResolver xmlResolver, String baseUri)
   at System.Security.Cryptography.Xml.Reference.CalculateHashValue(XmlDocument
   document, CanonicalXmlNodeList refList)
   at System.Security.Cryptography.Xml.SignedXml.BuildDigestedReferences()
   at System.Security.Cryptography.Xml.SignedXml.ComputeSignature()
Run Code Online (Sandbox Code Playgroud)

它给出了“内存不足”,但我们仍然有 30 …

.net c# memory memory-management windows-server-2008

6
推荐指数
2
解决办法
4963
查看次数