最近剛換了服務器,開始測試的時候未發現什麼問題,但是一旦同一時間段操做的人比較多的時候,就會拋出以下錯誤:web
Server Error in '/' Application.服務器
Exception of type 'System.OutOfMemoryException' was thrown.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 測試
Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.spa
開始的時候,覺得是程序錯誤,後來發現,全部的畫面就有這個錯誤,因而,就估計是服務器的問題,因而就試着將IIS從新啓動,果真問題解決了code
但是,治標不治本,後來的幾天,天天都會不定時的拋出這個錯誤,終於意識到,這個確定不是偶然的,因而開始上網搜索對應的解決方法。終於找到了正確的方法orm
1 查找到服務器對應的路徑下的:C:\Windows\Microsoft.NET\Framework\v4.0.30319(注意對應的framework版本)-->Aspnet.configxml
2 在<runtime> 節點下添加<gcServer enabled="false" />這句話便可ip
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<runtime>
<gcServer enabled="false" />
<legacyUnhandledExceptionPolicy enabled="false" />
<legacyImpersonationPolicy enabled="true"/>
<alwaysFlowImpersonationPolicy enabled="false"/>
<SymbolReadingPolicy enabled="1" />
<shadowCopyVerifyByTimestamp enabled="true"/>
</runtime>
<startup useLegacyV2RuntimeActivationPolicy="true" />
</configuration>it