gpt4 book ai didi

asp.net-2.0 - 生产服务器系统内存不足异常

转载 作者:行者123 更新时间:2023-12-04 19:52:28 26 4
gpt4 key购买 nike

我们在生产服务器上安装了 .net 应用程序。它在 RAM 为 4 GB 的 Windows Server 2003 上使用 .net FrameWork 3.0。但是应用程序在运行时存在问题,有时会抛出系统内存不足异常。我对此感到非常沮丧。我也无法模拟这个问题。我检查了所有可能导致问题的可能性,但没有得到任何解决问题的方法

我检查了生产服务器事件日志,发现内存不足异常以及无效 View 状态日志。查看以下事件日志,这可能有助于找到解决方案。

Exception information:     Exception type: HttpException     Exception message: Invalid viewstate. Request information:     Request path: /zContest/ScriptResource.axd     User: LisaA     Is authenticated: True     Authentication Type: Forms Thread information:     Thread ID: 10     Is impersonating: True     Stack trace:    at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType)   at System.Web.UI.Page.DecryptString(String s)   at System.Web.Handlers.ScriptResourceHandler.DecryptParameter(NameValueCollection queryString)   at System.Web.Handlers.ScriptResourceHandler.ProcessRequestInternal(HttpResponse response, NameValueCollection queryString, VirtualFileReader fileReader)   at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context)   at System.Web.Handlers.ScriptResourceHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context)   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------Event code: 3005 Event message: An unhandled exception has occurred. Process information:     Process ID: 5388     Process name: w3wp.exe  Exception information:     Exception type: OutOfMemoryException     Exception message: Exception of type 'System.OutOfMemoryException' was thrown. ------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------

请帮我解决这个问题

最佳答案

我发现这是一个与分配给大对象堆和应用程序池内存回收设置的 IIS 上的 .NET 内存管理相关的问题。

在物理内存为 1GB 或更少的 32 位服务器上,服务器将默认内存回收率为物理内存使用量的 60%,即大约 600MB。超过 600MB 时,您会注意到 outofmemoryexceptions 显着增加,这是 Microsoft 自己承认的。

http://msdn.microsoft.com/en-us/library/ms972959.aspx

A memory limit of 60% of physical RAM is recommended to avoid paging, especially when a new process replaces the old one due to excessive memory consumption. ..... It is important to adjust the memory limit on machines with large amounts of physical RAM, so that the cache memory manager and process recycling function properly. For example, assume you have a server with 4 gigabytes (GB) of physical RAM that is using the default memory limit. This is a problem. Sixty percent of physical RAM is 2.4 GB, which is larger than the default virtual address space of 2 GB. So what should the memory limit be set to? ...... There are a couple things to consider: First, the likelihood of experiencing an OutOfMemoryException begins to increase dramatically when "Process\Virtual Bytes" is within 600 MB of the virtual address space limit (generally 2 GB),

对于 1GB 的物理内存,默认设置就可以了,但是对于大于 1GB 的物理内存,您将需要对应用程序池内存回收设置进行一些调整或更改适当的配置数据库设置。

其他相关文章:

关于asp.net-2.0 - 生产服务器系统内存不足异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1791812/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com