Exception of type 'System.OutOfMemoryException' was thrown


  最近剛換了服務器,開始測試的時候未發現什么問題,可是一旦同一時間段操作的人比較多的時候,就會拋出如下錯誤:

   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.

  開始的時候,以為是程序錯誤,后來發現,所有的畫面就有這個錯誤,於是,就估計是服務器的問題,於是就試着將IIS重新啟動,果然問題解決了

  可是,治標不治本,后來的幾天,每天都會不定時的拋出這個錯誤,終於意識到,這個肯定不是偶然的,於是開始上網搜索對應的解決方法。終於找到了正確的方法

  1 查找到服務器對應的路徑下的:C:\Windows\Microsoft.NET\Framework\v4.0.30319(注意對應的framework版本)-->Aspnet.config

  2 在<runtime> 節點下添加<gcServer enabled="false" />這句話即可

     

<?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>

       

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM