GAC 是否会修复 ASP.NET/IIS6.0 System.OutOfMemoryException?

发布于 2024-07-07 05:53:52 字数 240 浏览 9 评论 0原文

我在同一应用程序池下的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

谁与争疯 2024-07-14 05:53:52

将某些内容放入 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.

烂柯人 2024-07-14 05:53:52

确保在 Machine.Config 中设置了部署 Retail = "true":

<system.web>
    <!--
        <deployment
            retail = "false" [true|false]
        />
    --> 
   <deployment retail="true" />
</system.web>

调试代码比非调试代码占用更多内存,并且编译为单个程序集而不是每页一个程序集将减少程序集加载的内存开销。

确保应用程序池的内存设置足够高,并且您可能还需要查看 ProcessModel MemoryLimit 设置:
http://msdn.microsoft.com/en-us /library/7w2sway1(VS.71).aspx

并尝试使用 80% 或 85% 设置:

<processModel 
  memoryLimit="80"
/>

Make sure you have deployment retail = "true" set in the Machine.Config:

<system.web>
    <!--
        <deployment
            retail = "false" [true|false]
        />
    --> 
   <deployment retail="true" />
</system.web>

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:

<processModel 
  memoryLimit="80"
/>
是伱的 2024-07-14 05:53:52

将共享程序集放入 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.

别挽留 2024-07-14 05:53:52

这是在什么类型的请求上发生的?
您可能想阅读有关 OutOfMemoryExceptions 的常见原因

What type of request did this occur on?
You might want to read about this common cause of OutOfMemoryExceptions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文