简单的问题:x86 应用程序可以利用 x64 操作系统提供的额外 RAM 吗?

发布于 2024-10-17 18:26:16 字数 344 浏览 7 评论 0原文

我希望有一点知识的人能够澄清这一点。关于运行 64 位操作系统(例如 Windows 7 x64)的原因有很多讨论,但许多人似乎认为他们的旧 x86 应用程序将能够利用任何大于 3.5GB 的 RAM。

不过,据我了解,x86 应用程序无法寻址那么高的内存......除非它们经过专门编程(很少有人会拥有)。

有知识的人可以一劳永逸地为我解决这个问题吗? 32 位应用程序可以利用运行 8GB RAM 的系统吗?

例如,如果用户决定(无论出于何种原因)同时运行多个 x86 应用程序,尽可能填充 RAM,是否会使用 Windows 7 x64 中可用的额外可寻址内存?

谢谢!

I hope someone with a bit of knowledge can clear this up. There's many discussions about the reasons to run a 64-bit OS (e.g. Windows 7 x64), but many people seem to think that their old x86 apps will be able to take advantage of any RAM greater than 3.5GB.

As I understand it, though, x86 apps cannot address memory that high... unless they've been specifically programmed to (which very few will have).

Can someone knowledgeable clear this up for me, once and for all? Can 32-bit apps take advantage of a system running 8GB of RAM?

E.g. If a user decided (for whatever reason) to run several x86 apps at once, filling the RAM as much as possible, would the extra addressable memory available in Windows 7 x64 be used?

Thanks!

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

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

发布评论

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

评论(5

九局 2024-10-24 18:26:16

在 64 位系统上,32 位应用程序能够使用完整的 4GB 虚拟地址空间,减去大约 64K。默认的 32 位 Windows 系统只允许 32 位进程使用 2 GB 的虚拟地址空间。通过专门配置操作系统,可以将该限制提高到 3 GB,但它仍然不如 64 位版本的 Windows 上的那么好。

如果您有 8GB 内存,则该 8GB 可以在多个 32 位进程之间分配,并且在必要时将利用整个 8GB。但是,不会为单个 32 位进程分配超过 4 GB 的内存。

On a 64 bit system, 32 bit applications are able to use the full 4GB virtual address space, minus about 64K. A default 32 bit windows system will only allow a 32 bit process to use 2 GB of virtual address space. By specially configuring the OS it's possible to push that limit up to 3 GB, but it's still not as good as what you would get on a 64 bit version of windows.

If you have 8GB of ram, that 8 GB can be divided up between multiple 32 bit processes, and the entire 8 GB will be utilized if necessary. However, no single 32 bit process will be allocated more than 4 GB of memory.

自在安然 2024-10-24 18:26:16

虽然我没有可引用的来源,但据我所知:32 位应用程序本身无法寻址超过 4GB 的内存,除非它使用一些技巧(这是非常不可能的),但如果你有一些 32 位应用程序正在运行同时,它们每个都可以有 4GB,因此两个 32 位应用程序应该能够使用全部 8GB 内存。虽然我不是100%确定。

Although i don't have sources to cite, but from my knowledge: 32bit app will not be able to address more than 4GB of memory itself, unless it uses some tricks(that is very unlikely), but if you have some 32bit apps running at the same time, they can all have 4GB each, and thus two 32bit apps should be able to use all 8GB of memory. Though I'm not 100% sure.

可遇━不可求 2024-10-24 18:26:16

是的。如果没有特殊技巧,x86 应用程序不能一次使用超过 2GB 的内存,但它们可以使用任何可用的内存。

Yes. x86 apps cannot use more than 2GB of memory at once without special tricks, but they can use any memory available.

随风而去 2024-10-24 18:26:16

添加到其他(正确的)答案:

  1. 应该使用“过程”一词而不是“应用程序”一词。应用程序通常由多个进程组成,而此处讨论的限制适用于单个进程。
  2. 因此,应用程序受益于 x64,x64 要么与 LARGEADDRESSAWARE 标志链接(它们可以使用 4 GB 而不是 2 GB),要么在多个进程之间共享负载。
  3. 通过使用 AWE,32 位进程甚至可以在 32 位系统上使用超过 4 GB RAM。但 32 位进程一次只能使用 2 GB(在 64 位上使用 LARGEADDRESSAWARE 时分别为 4 GB)。 AWE 主要由数据库使用,整个数据库适合 RAM 对性能至关重要。它的工作原理是在更大的内存块中提供 2 GB 的窗口。

以下是一些供进一步阅读的文章:

Windows x64 – 相同但又截然不同,第 1 部分:虚拟内存

Windows x64 – 完全相同但又截然不同,第 2 部分:内核内存、/3GB、PTE、(非)分页池

x64?我的终端服务器在 32 位和 8/12/16 GB RAM 下运行得很好!

Adding to the other (correct) answers:

  1. Instead of the term "application" the word "process" should be used. Applications often consist of multiple processes whereas the limits discussed here apply to single processes.
  2. Thus applications benefit from x64 that either are linked with the LARGEADDRESSAWARE flag (they can use 4 GB instead of 2 GB) or that share the load between multiple processes.
  3. 32-bit processes can work with more than 4 GB RAM even on 32-bit systems by using AWE. But a 32-bit process can only ever use 2 GB at once (4 GB with LARGEADDRESSAWARE on 64 bit respectively). AWE is primarily used by databases where it is essential for performance that the entire database fit into RAM. It works by providing a 2 GB window into a larger chunk of memory.

Here are some articles for further reading:

Windows x64 – All the Same Yet Very Different, Part 1: Virtual Memory

Windows x64 – All the Same Yet Very Different, Part 2: Kernel Memory, /3GB, PTEs, (Non-) Paged Pool

x64? My Terminal Servers Run Just Fine With 32 Bits and 8/12/16 GB RAM!

暖伴 2024-10-24 18:26:16

例如,如果用户决定(无论出于什么目的)
原因)运行多个 x86 应用程序
一次,填充 RAM 尽可能多
可能的话,额外的可寻址
Windows 7 x64 中的可用内存为
用过吗?

答案是肯定的。这是虚拟地址空间给我们带来的好处之一——每个进程(对于进程而言)能够看起来就像在从 0 开始并从那里向上的线性地址空间中执行一样。

就每个 32 位应用程序而言,它都有自己的 0 到 2 GB 的地址空间(无需特殊技巧)。操作系统处理虚拟地址到物理地址的转换。

E.g. If a user decided (for whatever
reason) to run several x86 apps at
once, filling the RAM as much as
possible, would the extra addressable
memory available in Windows 7 x64 be
used?

The answer is yes. That's one of the benefits a virtual address space gives us--the ability for each process to appear (to the process) as though it's executing in a linear address space that starts at 0 and goes up from there.

As far as each of the 32-bit applications is concerned, it has its own address space from 0 to 2 gigabytes (without special tricks). The operating system handles the virtual-to-physical address translation.

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