问题描述
如果Windows应用程序在映像头中设置了IMAGE_FILE_LARGE_ADDRESS_AWARE
(通过/LARGEADDRESSAWARE编译器标志),则通常允许32位应用程序使用2GB以上的内存(仅当32位应用程序使用32GB内存时才有意义)位操作系统已在boot.ini中设置了3GB开关).有关更多信息,请参见 MSDN文章/3GB .
If a Windows application has the IMAGE_FILE_LARGE_ADDRESS_AWARE
set in the image header (via the /LARGEADDRESSAWARE compiler flag), this is typically to allow a 32-bit application to use more than 2GB of memory (only makes sense if the 32-bit Operating System has set the 3GB switch in boot.ini). See MSDN article /3GB for more info.
我的问题是,如果您在未设置3GB开关的系统上运行此应用程序,会发生什么情况.只是被忽略了吗?还是该应用程序会尝试使用3GB的堆并由于用户空间只有2GB的可用空间而出现内存不足的错误?
My questions is, what happens if you run this application on a system that does NOT have the 3GB switch set. Is it simply ignored? Or will the app try and use a 3GB heap and get out-of-memory errors because the userspace only has 2GB available?
我不断听到关于2GB用户空间系统忽略LARGEADDRESSAWARE开关的信息,但找不到与此有关的任何正式Microsoft文档.
I keep hearing anecdotally that the LARGEADDRESSAWARE switch is ignored for 2GB userspace systems but cannot find any official Microsoft documentation on this.
谢谢.
推荐答案
基本上IMAGE_FILE_LARGE_ADDRESS_AWARE
告诉系统,我知道设置高位的地址不是负数,并且可以处理它们".如果系统准备提供2GB以上的用户模式地址,则它将提供.如果系统不准备提供这些地址(例如,没有/3GB设置的32位Windows操作系统),则该过程无论如何都无法获得这些地址-但不会造成任何危害.
Basically the IMAGE_FILE_LARGE_ADDRESS_AWARE
tells the system, "I know that addresses with the high bit set are not negative, and can handle them".If the system is prepared to provide user mode addresses above 2GB, then it will. If the system is not prepared to give those addresses (ie., a 32-bit Windows OS without the /3GB setting), the process can't get those addresses anyway - but no harm done.
还请注意,如果将映像设置为IMAGE_FILE_LARGE_ADDRESS_AWARE
位,它将在Win64系统上访问2GB以上的地址空间,该系统不支持(或不需要)/3GB开关.一个32位应用程序将获得接近4GB的地址空间,而一个64位应用程序将获得巨大的地址空间-7TB至8TB,具体取决于平台(默认情况下,64位版本将其设置为该位).
Also note that if an image has the IMAGE_FILE_LARGE_ADDRESS_AWARE
bit set it will get access to address space above 2GB on Win64 systems, which do not support (or need) the /3GB switch. A 32-bit application will get an address space of something close to 4GB and a 64-bit application will get a huge address space - 7TB to 8TB depending on the platform (64-bit builds set the bit by default).
http://msdn.microsoft.com/en-us/library/aa366778.aspx#memory_limits
这篇关于IMAGE_FILE_LARGE_ADDRESS_AWARE和3GB操作系统切换器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!