32 位程序可以在 64 位操作系统上使用超过 4GB 的内存吗?
在 64 位操作系统上运行的 32 位程序是否能够使用超过 4GB 的内存(如果可用)?
Is a 32-bit program running on a 64-bit OS able to use more than 4GB of memory if available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
简短的回答是:是的。
更长的答案取决于。硬件支持页面重新映射,这基本上为您的程序提供了一个将几个页面的窗口放入更大的内存区域的窗口。
然而,该窗口应该由程序本身管理,并且不会得到内存管理器的支持。有一些程序可以执行此操作,例如 Windows 上的 SQL。
然而,一般来说这是一个坏主意,程序应该将自身限制为 4GB 或移动到 64 位:)
Short answer is: yes.
Longer answer is depends. There is a hardware support for page re-mapping, which basically gives your program a window of a few pages into a larger area of memory.
This window is however, should be managed by the program itself and will not get support from memory manager. There are examples of programs doing that like SQL on Windows.
However, in general it is a bad idea and the program should either limit itself for 4GB or move to 64bits :)
通常,您的地址空间仅限于 2GB,其中所有分配及其开销、碎片等都必须与内存映射文件(包括您的程序及其使用的 DLL)相适应。这实际上将您限制为 1.5GB。
使用特殊配置,例如 /3GB,您可以为应用程序提供超过 2GB 的可用空间,但这样做会抢占内核空间,从而消耗文件缓存、处理容量等。
在 Win32 上,您可以使用 PAE 支持,但它不透明,你必须自己管理。
Normally you're limited to a 2GB address space, in which all your allocations and their overhead, fragmentation, etc., must fit along with memory-mapped files (which includes your program and the DLLs it uses). This effectively limits you to 1.5GB.
With special configuration, e.g. /3GB, you can make more than 2GB available to applications, but by doing so you rob the kernel of space, costing you file caching, handle capacity, etc..
On Win32, you can use more with PAE support, but it's not transparent, you have to manage it yourself.
仅通过显式地将 4GB 范围的内存映射到其地址空间中。
Only by explicitly mapping 4GB ranges of memory into its address space.