我有一个消耗大量内存的程序(x64)。我正在win server 2008 R2 SP1
使用48 GB RAM(64 bit)
,运行它.net frame work 4.5
。
我也在gcAllowVeryLargeObjects = true
app.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()
它给出了“内存不足”,但我们仍然有 30 GB 的可用内存。是.net应用程序的限制还是给我这个错误的服务器。