简体   繁体   English

在64位OS内存消耗上运行的32位程序

[英]32bit program running on 64bit OS Memory Consumption

We have a windows server 2008 R2 32G memory machine, this is obviously a 64bit OS. 我们有一台Windows Server 2008 R2 32G内存机器,这显然是64位操作系统。 And we installed XAMPP 32bit version, with 32bit MySQL and PHP. 并且我们安装了XAMPP 32位版本,以及32位MySQL和PHP。 Then we host an webmail system written in PHP on it. 然后,我们托管一个用PHP编写的Webmail系统。 My question is : will those 32bit MySQL and 32bit PHP consume more than 4G memory of the OS ? 我的问题是:那些32位MySQL和32位PHP是否会占用操作系统的4G以上内存? Do We have to install 64bit MYSQL and PHP to achive this result ? 我们是否必须安装64位MYSQL和PHP才能获得此结果?

Thank you 谢谢

Based on the x86 architecture instruction set, a software compiled in 32 bits won't ever be able to allocate more than 4GiB since they won't be able to access this memory directly. 基于x86体系结构指令集,用32位编译的软件将永远无法分配超过4GiB的内存,因为它们将无法直接访问该内存。 As they use 32 bits to represent memory addresses, and since 2^32 = 4GiB (rounded), they won't be able to represent any address further. 由于它们使用32位表示内存地址,并且由于2 ^ 32 = 4GiB(四舍五入),因此它们将无法进一步表示任何地址。

On a side note, a software could indirectly work with more than 4GiB of memory on a 32 bits system by using PAE, but the software must be explicitly developed to use this. 附带说明一下,通过使用PAE,软件可以在32位系统上间接处理超过4GiB的内存,但是必须明确开发该软件才能使用它。

You need the 64 bits version of every software and their libraries otherwise you won't be able to use more than 4GiB directly, even if the OS recognize all your memory. 您需要每个软件及其库的64位版本,否则即使操作系统可以识别您的所有内存,也无法直接使用4GiB以上的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM