设置了LARGEADDRESSAWARE标志的应用程序可获得更少的虚拟内存 [英] Application with LARGEADDRESSAWARE flag set getting less virtual memory

查看:85
本文介绍了设置了LARGEADDRESSAWARE标志的应用程序可获得更少的虚拟内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由一个exe和多个dll组成的32位应用程序.该exe是使用/LARGEADDRESSAWARE标志集构建的.因此,我期望在64位操作系统上,我应该获得4 GB的用户地址空间.但是在某些64位Win 7系统上,我仅获得2 GB的用户地址空间.如果这很重要,则物理内存为8 GB.这种行为可能是什么原因?

I have a 32 bit application consisting one exe and multiple dlls. The exe has been built with /LARGEADDRESSAWARE flag set. So I expect on a 64 bit OS I should get 4 GB of user address space. But on some 64 bit Win 7 systems I am getting only 2 GB of user address space. The physical memory is 8 GB if that matters. What could be reason for this behavior?

推荐答案

浏览MSDN后,我发现了以下内容:

After browsing through MSDN, I found the following:

http://msdn.microsoft.com/zh-cn/library/windows/desktop/aa366770(v=vs.85).aspx (由GlobalMemoryStatusEx使用的MEMORYSTATUSEX页面(

On http://msdn.microsoft.com/en-us/library/windows/desktop/aa366770(v=vs.85).aspx (the page for MEMORYSTATUSEX which is used by GlobalMemoryStatusEx (http://msdn.microsoft.com/en-us/library/windows/desktop/aa366589(v=vs.85).aspx) ) the description for ullTotalVirtual is:

对于x86处理器上的大多数32位进程,此值约为2 GB,对于在启用4 GB调优的系统上运行的具有大地址识别功能的32位进程,此值约为3 GB.

this value is approximately 2 GB for most 32-bit processes on an x86 processor and approximately 3 GB for 32-bit processes that are large address aware running on a system with 4-gigabyte tuning enabled.

4GB调整页面为: http://msdn.microsoft.com/zh-CN/library/windows/desktop/bb613473(v = vs.85).aspx ,它表示类似以下内容:

The 4GB tuning page is: http://msdn.microsoft.com/en-us/library/windows/desktop/bb613473(v=vs.85).aspx and it says something like:

在Windows的64位版本上,标有IMAGE_FILE_LARGE_ADDRESS_AWARE标志的32位应用程序具有4 GB的可用地址空间.

On 64-bit editions of Windows, 32-bit applications marked with the IMAGE_FILE_LARGE_ADDRESS_AWARE flag have 4 GB of address space available.

Windows Server 2003的Itanium版本:在SP1之前,32位进程只有2 GB的地址空间可用.

Itanium editions of Windows Server 2003: Prior to SP1, 32-bit processes have only 2 GB of address space available.

此外,内存限制页( http://msdn.microsoft如果您要确定系统支持的总内存,则.com/en-us/library/aa366778.aspx#memory_limits )会很方便.

Also, the memory limits page (http://msdn.microsoft.com/en-us/library/aa366778.aspx#memory_limits) can come handy if you want to determine the total memory your system supports.

但是真正有用的信息来自Mark Russinowich的博客: http://blogs.technet.com/b/markrussinovich/archive/2008/07/21/3092070.aspx

However the real useful information comes from Mark Russinowich's blog: http://blogs.technet.com/b/markrussinovich/archive/2008/07/21/3092070.aspx

虽然32GB客户端SKU的许可限制为4GB,但有效限制实际上较低,并且取决于系统的芯片组和连接的设备.原因是物理地址映射不仅包括RAM,而且还包括设备内存,并且x86和x64系统映射4GB地址边界以下的所有设备内存,以与不知道如何处理的32位操作系统保持兼容.地址大于4GB.

While 4GB is the licensed limit for 32-bit client SKUs, the effective limit is actually lower and dependent on the system's chipset and connected devices. The reason is that the physical address map includes not only RAM, but device memory as well, and x86 and x64 systems map all device memory below the 4GB address boundary to remain compatible with 32-bit operating systems that don't know how to handle addresses larger than 4GB.

因此得出的结论是,是的,这可能取决于系统的配置.也许您可以用一个表,每个系统上获得的内存量以及一些重要的系统配置设置来完成您的问题,在这种情况下,我们可能会发现一个模式.

So the conclusion is that yes, this might depend on the configuration of the system. Maybe you can complete your question with a table, with the amount of the memory you get on each system and some important system configuration settings, and we might discover a pattern in this case.

这篇关于设置了LARGEADDRESSAWARE标志的应用程序可获得更少的虚拟内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆