GAC 是否会修复 ASP.NET/IIS6.0 System.OutOfMemoryException?
我在同一应用程序池下的 IIS 6.0、Windows Server 2003 机器上安装了许多应用程序实例。 它们共享许多相同的程序集,并且无法连接到单个应用程序中。
我最近添加了该应用程序的一个新实例,并在尝试加载 ASP.NET 2.0 应用程序时获得了 System.OutOfMemoryException。
使用 GAC 存储通用程序集是否可以修复此错误,或者只能通过在不同应用程序池之间分隔站点来解决此问题?
I have many instances of an application installed on an IIS 6.0, Windows Server 2003 box under the same application pool. They share many of the same assemblies and can not be joined in to a single application.
I recently added a new instance of the application and obtained a System.OutOfMemoryException when I tried to load the ASP.NET 2.0 application.
Will using the GAC to store common assemblies fix this error or can this only be remedied by spacing the sites between different application pools?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
将某些内容放入 GAC 中只会更改 DLL 的物理位置(以及安全设置),而不会更改加载到内存中的内容。
大多数人倾向于将 GAC 视为“微软放置其东西的地方”。 我还没有看到很多由“其他人”创建的应用程序可以证明使用 GAC 的合理性。
您可能应该开始考虑负载平衡解决方案,以免您的计算机承受如此大的 RAM 压力。
Putting something in the GAC only changes the physical location of the DLL (and security settings), it doesn't change what's loaded into memory.
Most people tend to think of the GAC as "where Microsoft puts their stuff". I haven't seen many applications created by "everybody else" that can justify using the GAC.
You should probably start thinking about a load-balancing solution of you are putting that much RAM pressure on your machine.
确保在 Machine.Config 中设置了部署 Retail = "true":
调试代码比非调试代码占用更多内存,并且编译为单个程序集而不是每页一个程序集将减少程序集加载的内存开销。
确保应用程序池的内存设置足够高,并且您可能还需要查看 ProcessModel MemoryLimit 设置:
http://msdn.microsoft.com/en-us /library/7w2sway1(VS.71).aspx
并尝试使用 80% 或 85% 设置:
Make sure you have deployment retail = "true" set in the Machine.Config:
Debug code takes a lot more memory then non-debug, and compiling into single assemblies rather than one per page will reduce the memory overhead of assembly loads.
Make sure you're memory settings on your application pools are set high enough, and you also might want to take a look at the ProcessModel MemoryLimit setting:
http://msdn.microsoft.com/en-us/library/7w2sway1(VS.71).aspx
And try using an 80% or 85% setting:
将共享程序集放入 GAC 中可以节省驱动器空间,例如。 如果您有 20 个使用相同 dll 的 asp 应用程序。 我不确定,也可能是您将相同 dll 的较少副本加载到内存中。 也就是说,OutOfMemoryErrors 更有可能是由于将非常大的对象加载到内存中而引起的,一个典型的例子是 DataSet。 与内存中大型数据集或大型 xml 文件占用的内存相比,程序集很小。
Putting a shared assembly into the GAC saves drive space, eg. if you have 20 asp applications that use the same dll. It might be the case that you load fewer copies of teh same dll into memory as well, I'm not sure. That said, OutOfMemoryErrors are more likely to be caused by loading extremely large obejects into memory, a typical example is a DataSet. Assemblies are small in comparison to the memory you can eat up with large datasets or large xml files in memory.
这是在什么类型的请求上发生的?
您可能想阅读有关 OutOfMemoryExceptions 的常见原因。
What type of request did this occur on?
You might want to read about this common cause of OutOfMemoryExceptions.