Platform SDK: Memory

Address Windowing Extensions

This topic describes the Address Windowing Extensions (AWE). These Windows 2000 extensions provide user applications with 32-bit virtual addressing to greater than 32-bit regions of physical memory.

Windows NT and Windows 2000 have always provided applications with a flat 32-bit virtual address space, which describes 4 gigabytes (4GB) of virtual memory. The address space is usually split so that 2GB of address space is directly accessible to the application. The other 2GB is accessible only to the executive software. Additionally, with Windows NT 4.0 SP3, an option is provided on Windows NT Server Enterprise Edition/Windows 2000 Advanced Server x86 systems for applications to have a 3GB flat virtual address space, with the executive software using only 1GB.

AWE is a set of extensions that allows an application with the Lock Pages in Memory user right to use physical nonpaged memory and window views to various portions of this physical memory within a 32-bit virtual address space. In this way, applications are able to quickly manipulate physical memory greater than 4GB. Certain data-intensive applications, such as database management systems and scientific and engineering software, need access to very large caches of data. In the case of very large data sets, restricting the cache to fit within an application's 2GB of user address space is a severe restriction. In these situations, the cache is too small to properly support the application.

AWE solves this problem by allowing applications to directly address huge amounts of memory while continuing to use 32-bit pointers. AWE allows applications to have data caches larger than 4GB (where sufficient physical memory is present).

AWE places a few restrictions on how this memory may be used, primarily because these restrictions allow extremely fast mapping, remapping, and freeing. Fast memory management is important for these potentially enormous address spaces.

This solution addresses the physical memory issues in a very general, widely applicable manner. Some of the benefits of AWE are:

To obtain the Lock Pages in Memory privilege, an administrator must add the attribute "Lock Pages in Memory" to the user's User Rights Assignments. For more information on how to do this, see "User Rights" in the Windows 2000 help system.

The following functions make up the Address Windowing Extensions (AWE) API.

Function Description
VirtualAlloc Reserve a portion of virtual address space to use for AWE, using MEM_PHYSICAL.
AllocateUserPhysicalPages Allocate physical memory for use with AWE.
MapUserPhysicalPages Map (or invalidate) AWE virtual addresses onto any set of physical pages obtained with AllocateUserPhysicalPages.
MapUserPhysicalPagesScatter Map (or invalidate) AWE virtual addresses onto any set of physical pages obtained with AllocateUserPhysicalPages, but with finer control than that provided by MapUserPhysicalPages.
FreeUserPhysicalPages Free physical memory that was used for AWE.