Exception of type System.OutOfMemoryException was thrown.

Source: Internet
Author: User
Tags stack trace win32
Exception of type System.OutOfMemoryException was thrown. Description: An unhandled exception occurred during the execution to the current Web request. Please review the "stack Trace for" Information about the error and where it originated in the code.

Exception Details: System.OutOfMemoryException:Exception of type System.OutOfMemoryException was thrown.

Source Error:

An unhandled exception is Gener Ated during the execution of the current Web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. the

Stack Trace:

,
 [Outofmemoryexception:exception of type System.OutOfMemoryException was thrown.] 
Posted by Venjiang on 2005-7-13 10:23 PM
Just looking at the RSS list, see a piece of such information, I do not know if it is helpful to you.
------------------------------------------------------------------------------------------

Asp. NET in the OutOfMemoryException

In the blog Park saw a friend wrote the article "How to deal with OutOfMemoryException exceptions." , so I want to communicate with you about the problem of outofmemoryexception in asp.net.

In fact, on the ASP.net Web server, ASP. NET can not normally be equated with all the amount of memory. In the Machine.config configuration file, there is a property "MemoryLimit" in the configuration section <processModel>, the value of this property is a hundred score, default is "60", The asp.net process is specified (you can see the asp.net process in Task Manager, IIS5 in ASPNET_WP,IIS6 for w3wp) to use 60% of all physical memory. When the amount of memory used by asp.net exceeds this limit, IIS begins the automatic recycle (recycle) process, which is to create a new process to handle HTTP requests and reclaim the memory used by the old processes.

When we have a server with a large memory, the value of "memorylimit" needs to be adjusted appropriately. For example, we prepared a server that Chemas-microsoft-comfficemarttags "/>t=" on ">4g memory, then t=" on ">4gx60%=t=" on ">2.4g. However, for the WIN32 operating system, all the memory space a process can occupy is only t= "on" >2g. When the memory consumed by the ASP.net process begins to reach the t= "on" >2g, IIS does not start the &GT;2.4G process operation because it does not reach the "recycle threshold" of the t= "on" recycle, but because of the Win32 limit, In fact, the process cannot be allocated more memory, so the outofmemoryexception is likely to be thrown out. To avoid this, we have to properly reduce the "memorylimit" to allow IIS to recycle the process earlier.

Microsoft's recommended asp.net process consumes no more than 60% of the memory, and it is best to make the actual calculated value no more than t= "on" >800m. That is, for a server that t= "on" >4g memory, it is a good idea to set the "MemoryLimit" property to "20". Set an appropriate recovery threshold, so that IIS timely process recycling, to ensure the stable operation of the entire server, to avoid outofmemoryexception is very important.

In IIS6, ASP. NET process is no longer determined by the "memorylimit" attribute in the configuration section, but by the settings in the application pool configuration in IIS Manager.

However, even if these configurations are set correctly, there is no guarantee that outofmemoryexception will not be completely avoided, possibly because of the variety and complexity of memory-recycling operations, for example, that may take too long. What developers should be aware of is that you should always keep in mind that you don't use and waste memory in your code. :)

If you have a server with a large memory, and you are frustrated with the WIN32 operating system's maximum use of t= "on" >2g memory, there are two optional solutions:
1, the use of/3GB mode to start the computer, method to participate in the text after the link
2. Use Windows Server 2003 64bits Edition

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.