问题
I have an 32bit application with very large memory requirements.
I noticed that there is something called Address Windowing Extension.
However I haven't found much information in regards to how to use it and also what disadvantages and problems one might run into while using this?
回答1:
- It shouldn't work on versions of Windows at 64bits (read here http://msdn.microsoft.com/en-us/library/aa366778.aspx Intel and AMD's specification of PAE does support the x86-64 architecture but the software layer of Microsoft's PAE (the API), called AWE, is not supported on 64 bit editions of Windows, so Windows Vista 64 bit cannot attribute more than 4 GiB of RAM for a 32 bit application.).
- Even on Windows 32 bits there is a "license" limit on the amount of memory usable (same page shows all the limits).
- And clearly it's complex to program :-) It's like using EMS on the old 8086.
回答2:
Well the truth is that you can use AWE from a 32bits application running inside a Windows OS 64bit, and you don't need PAE. For example MS SQL Server (before 2012 version) can be configured in this mode.
But unless you have a very specific requirements, probably is far a better option to port to 64bits.
You have several disvantages:
- Need to run with a user with
SeLockMemoryPrivilege
- The memory can not be shared with other process. It is allocated in physical memory. Leaving less memory to the OS and other applications (with
AllocateUserPhysicalPages
). - You need a virtual address in order to access such memory. So you can have a memory windows of 4GiB with
LARGE_ADDRESS_AWARE
flag. - If you want to access more thant 4GiB you have to map/unmap those physical pages (with
MapUserPhysicalPages
).
This article from 1999 explain how to use such API.
来源:https://stackoverflow.com/questions/7282079/address-windowing-extension