问题描述
在Windows Server 2003 Enterprise Edition SP2下(未启用/3GB开关)
Under Windows Server 2003, Enterprise Edition, SP2 (/3GB switch not enabled)
据我了解,可能是错误的,一个进程的最大可寻址内存为4GB.
As I understand it, and I may be wrong, the maximum addressable memory for a process is 4GB.
是2GB的专用字节和2GB的虚拟字节吗?
Is that 2GB of private bytes and 2GB of virtual bytes?
达到专用字节数限制或虚拟字节数限制时,是否出现内存不足"错误?
Do you get "out of memory" errors when the private byte limit or virtual byte limit is reached?
推荐答案
从某种意义上说,一个进程的最大地址空间为4GB是正确的.对于每个进程,操作系统将占用一半的地址空间.可以使用3GB开关更改此设置,但可能会导致系统不稳定.因此,我们剩下2GB的可寻址内存供进程单独使用.好吧,不完全是.事实证明,该空间的一部分已被其他东西(例如DLL)和其他常见代码占用.程序员实际可用的内存约为1.5GB-1.7GB.
It is correct that the maximum address space of a process is 4GB, in a sense. Half of the address space is, for each process, taken up by the operating system. This can be changed with the 3GB switch but it might cause system instability. So, we are left with 2GB of addressable memory for the process to use on its own. Well, not entirely. It turns out that a part of this space is taken up by other stuff such as DLLs an other common code. The actual memory available to you as a programmer is around 1.5GB - 1.7GB.
我不确定您如何处理意外超过此限制,但是我知道由于这个原因在大型多人游戏地图中崩溃的游戏.要注意的另一件事是,除非32位程序启用/LARGEADDRESSAWARE:YES链接器标志,否则在64位系统上不能使用超过2GB的地址空间.
I'm not sure about how you can handle accidentally going above this limit but I know of games which crash in large multiplayer maps for this reason. Another thing to note is that a 32bit program cannot use more than the 2GB address space on a 64bit system unless they enable the /LARGEADDRESSAWARE:YES linker flag.
这篇关于Windows进程何时耗尽内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!