I saw an article "How to Handle outofmemoryexception?", So I 'd like to share with you the problem of outofmemoryexception in ASP. NET.
In fact, on the ASP. NET web server, the memory that ASP. NET can use is generally not equivalent to the total amount of memory. In the machine. in the config configuration file, the configuration section <processmodel> contains the "memorylimit" attribute. The value of this attribute is a hundred points. The default value is "60", indicating that ASP is specified. net process (in the task manager, you can see ASP.. Net Process, aspnet_wp in iis5, w3wp in IIS6) can use 60% of all physical memory. When ASP. when the memory used by net exceeds this limit, IIS starts to automatically recycle (recycle) processes, that is, creating a new process to handle HTTP requests, the memory occupied by the old process is recycled.
When we have a server with a large memory, the value of "memorylimit" needs to be adjusted appropriately. For example, if we have a 4G memory server, 4G x 60% = 2.4g. However, for Win32 operating systems, a process occupies only 2 GB of memory space. When the memory occupied by the ASP. NET process starts to reach 2 GB, IIS does not start the recycle process because it does not reach the "reclaim threshold" of 2 GB. However, due to Win32 restrictions