是在 64 位 Windows 上运行的 32 位 ASP.NET 应用程序 LARGEADDRESSAWARE

发布于 2024-08-09 14:55:22 字数 1110 浏览 0 评论 0原文

我有一个现有的 32 位 ASP.NET 应用程序,它使用 32 位非托管 DLL。

如果我在 64 位操作系统上运行它,它会自动成为 LARGEADDRESSAWARE(即可以访问完整的 4GB 虚拟内存)吗?

如果没有,我该怎么做才能使其成为 LARGEADDRESSAWARE?

谷歌搜索出现了这个问题,但它缺乏上述问题的答案。

编辑

此博客表明 ASP.NET 1.1 工作进程是 LARGEADDRESSAWARE,但对 ASP.NET 2.0 保持沉默:

如果系统使用 /3Gb 启动 boot.ini 中的开关(仅支持 企业版和数据中心版 Windows 2000 以及所有版本 Windows XP 和 Windows Server 2003)a 与链接的过程 /LARGEADDRESSAWARE 开关可以“看到” 3GB。 Aspnet_wp.exe 链接在其中 1.1 版本中的方式,可以采取 这样做的好处。

编辑2

这是另一个博客 表明 32 位 ASP.NET 应用程序是 LARGEADDRESSAWARE,但没有提及 ASP.NET 版本:

我们找到了以下组件 由 ASP.NET 框架托管的有 利用> 2 演出内存 空间

说,我对缺乏关于这个主题的权威公开信息感到惊讶。

I have an existing 32-bit ASP.NET application that used 32-bit unmanaged DLLs.

If I run this on a 64-bit OS, will it automatically be LARGEADDRESSAWARE (i.e. have access to the full 4GB of virtual memory)?

If not, what can I do to make it LARGEADDRESSAWARE?

Googling turned up this question, but it lacks the answer to the above question.

EDIT

This blog suggests that the ASP.NET 1.1 worker process is LARGEADDRESSAWARE, but is silent about ASP.NET 2.0:

If a system is booted with the /3Gb
switch in boot.ini (only supported on
Enterprise and Data Center editions of
Windows 2000, and all versions of
Windows XP and Windows Server 2003) a
process that is linked with the
/LARGEADDRESSAWARE switch can "see"
3Gb. Aspnet_wp.exe is linked in that
way in version 1.1 and can take
advantage of that.

EDIT 2

This is another blog that suggests that 32-bit ASP.NET apps are LARGEADDRESSAWARE, but doesn't mention the ASP.NET version:

We found the components that were
hosted by the ASP.NET framework were
taking advantage of the > 2 gig memory
space

I must say I'm amazed at the lack of authoritative published information on this subject.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

遗弃M 2024-08-16 14:55:22

我设法访问运行 Windows 2003 SP2 的服务器,答案似乎是肯定的,32 位 ASP.NET 应用程序是 LARGEADDRESSAWARE,并且可以访问完整的 4GB 虚拟内存。

我通过以下方法建立了这一点:

  • 使用“dumpbin /headers”检查 w3wp.exe(32 位 IIS 工作进程)。这表明 LARGEADDRESSAWARE 位已设置。

  • 运行尝试分配超过 2GB 虚拟内存的 32 位 ASP.NET 应用程序:此操作成功。

我认为 Windows 2008 / IIS7 的结果是相同的,但尚未测试。

I managed to get access to a server running Windows 2003 SP2, and the answer appears to be yes, 32-bit ASP.NET applications are LARGEADDRESSAWARE, and have access to the full 4GB of virtual memory.

I established this by:

  • examining w3wp.exe (the 32-bit IIS worker process) using "dumpbin /headers". This shows that the LARGEADDRESSAWARE bit is set.

  • running a 32-bit ASP.NET application that attempts to allocate over 2GB of virtual memory: this was successful.

I assume the result would be the same for Windows 2008 / IIS7, but haven't tested it.

踏月而来 2024-08-16 14:55:22

不,不会。要使其支持大地址,您必须将 IIS 作为 64 位应用程序运行(不使用 WOW 运行)。这意味着您的 32 位非托管 dll 将必须替换为 64 位版本。

通常,当选择针对任何平台的编译器选项(这是默认设置)时,asp.net 将转换为 64 位应用程序。您拥有的 32 位应用程序的问题是存在非托管 32 位 dll。这些不能在 64 位应用程序中运行。这意味着您必须将 ASP.NET 应用程序作为 32 位应用程序运行,这意味着您必须在 64 位服务器上安装 32 位版本的 IIS。避免这种情况的唯一方法是将 32 位非托管 dll 替换为设计用于在 64 位环境中运行的 dll。 32 位应用程序无法使用 64 位服务器上的所有内存,因此您的应用程序将无法“看到”额外的内存。

ASP.NET 应用程序将在 64 位环境中重新编译自身(前提是目标在编译时设置了任何环境选项),因此它们不再是 32 位应用程序。

No it will not. To make it large address aware, you have to run the IIS as a 64-bit application (not running using WOW). This means that your 32-bit unmanaged dlls will have to be replaced with the 64-bit versions of them.

Normally, asp.net will convert to a 64-bit application when selecting the compiler option to target any platform (which is the default). The problem with the 32-bit app you have is that there are unmanaged 32-bit dlls. These cannot run in a 64-bit application. This means that you have to run your ASP.NET application as a 32-bit application which means that you have to install the 32-bit version of IIS on your 64-bit server. The only way to avoid this is to replace the 32-bit unmanaged dlls with ones which are designed to run in a 64-bit environment. A 32-bit application can't use all of the memory on 64-bit server, so your application won't be able to "see" the additional memory.

ASP.NET apps will recompile themselves (providing the target any environment option is set at compile time) in a 64-bit environment, so they aren't 32-bit apps anymore.

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