Exception of type 'System.OutOfMemoryException' was thrown.

前端 未结 5 987
执念已碎
执念已碎 2021-02-03 22:18

I got the following problem

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more          


        
相关标签:
5条回答
  • 2021-02-03 22:41

    This problem usually occurs when some process such as loading huge data to memory stream and your system memory is not capable of storing so much of data. Try clearing temp folder by giving the command

    start -> run -> %temp%

    0 讨论(0)
  • 2021-02-03 22:41

    Running in Debug Mode

    When you're developing and debugging an application, you will typically run with the debug attribute in the web.config file set to true and your DLLs compiled in debug mode. However, before you deploy your application to test or to production, you should compile your components in release mode and set the debug attribute to false.

    ASP.NET works differently on many levels when running in debug mode. In fact, when you are running in debug mode, the GC will allow your objects to remain alive longer (until the end of the scope) so you will always see higher memory usage when running in debug mode.

    Another often unrealized side-effect of running in debug mode is that client scripts served via the webresource.axd and scriptresource.axd handlers will not be cached. That means that each client request will have to download any scripts (such as ASP.NET AJAX scripts) instead of taking advantage of client-side caching. This can lead to a substantial performance hit.

    Source: http://blogs.iis.net/webtopics/archive/2009/05/22/troubleshooting-system-outofmemoryexceptions-in-asp-net.aspx

    0 讨论(0)
  • 2021-02-03 22:57

    I just restarted Visual Studio and did IISRESET which solved the problem.

    0 讨论(0)
  • 2021-02-03 23:00

    If you're using IIS Express, select Show All Application from IIS Express in the task bar notification area, then select Stop All.

    Now re-run your application.

    0 讨论(0)
  • 2021-02-03 23:07

    Another thing to try is

    Tools -> Options -> search for IIS -> tick Use the 64 bit version of IIS Express for web sites and projects.

    0 讨论(0)
提交回复
热议问题