Can a 32-bit program use more than 4GB of memory on a 64-bit OS?

谁说胖子不能爱 提交于 2019-12-06 19:44:37

问题


Is a 32-bit program running on a 64-bit OS able to use more than 4GB of memory if available?


回答1:


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 :)




回答2:


Normally uou'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.




回答3:


Only by explicitly mapping 4GB ranges of memory into its address space.



来源:https://stackoverflow.com/questions/5916959/can-a-32-bit-program-use-more-than-4gb-of-memory-on-a-64-bit-os

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!