Chinaunix首页 | 论坛 | 博客
  • 博客访问: 846021
  • 博文数量: 756
  • 博客积分: 40000
  • 博客等级: 大将
  • 技术积分: 4980
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-13 14:40
文章分类

全部博文(756)

文章存档

2011年(1)

2008年(755)

我的朋友

分类:

2008-10-13 16:11:09

Address Windowing Extensions

Address Windowing Extensions (AWE) is a set of extensions that allows an application 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 uses physical nonpaged memory and window views of various portions of this physical memory within a 32-bit virtual address space.

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.

  • Virtual address ranges allocated for the AWE are not sharable with other processes (and therefore not inheritable). In fact, two different AWE virtual addresses within the same process are not allowed to map the same physical page. These restrictions provide fast remapping and cleanup when memory is freed.
  • The physical pages that can be allocated for an AWE region are limited by the number of physical pages present in the machine, since this memory is never paged – it is locked down until the application explicitly frees it or exits. The physical pages allocated for a given process can be mapped into any AWE virtual region within the same process. Applications that use AWE must be careful not to take so much physical memory that they cause other applications to page excessively or prevent creation of new processes or threads due to lack of resources. Use the function to monitor physical memory use.
  • AWE virtual addresses are always read/write and cannot be protected via calls to (that is, no read-only memory, noaccess memory, guard pages, and the like can be specified).
  • AWE address ranges cannot be used to buffer data for graphics or video calls.
  • An AWE memory range cannot be split, nor can pieces of it be deleted. Instead, the entire virtual address range must be deleted as a unit when deletion is required. This means you must specify MEM_RELEASE when calling .
  • Applications can map multiple regions simultaneously, provided they do not overlap.
  • Applications that use AWE are not supported in emulation mode. That is, an x86 application that uses AWE functions must be recompiled to run on another processor, whereas most applications can run without recompiling under an emulator on other platforms.

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

  • A small group of new functions is defined to manipulate AWE memory.
  • AWE provides a very fast remapping capability. Remapping is done by manipulating virtual memory tables, not by moving data in physical memory.
  • AWE provides page size granularity appropriate to the processor (for example, 4K on x86), which is more useful to applications than large pages (for example, 2MB or 4MB on x86).

An application must have the Lock Pages in Memory privilege to use AWE. To obtain this privilege, an administrator must add Lock Pages in Memory to the user's User Rights Assignments. For more information on how to do this, see "User Rights" in the operating system help.

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

Function Description

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

 

 

就是先分配一块大物理内存(其实就有点像LINUX的HUGETLB一样),然后通过一个类似窗口的东东不停的映射。MSDN上说用在像数据库这种吃内存的地方可能会比较好。

就普通的服务器来说,我觉得也可以加快内存访问速度(当然不一定要超过4G内存啦),因为这是物理内存啊,可能还不会被swap.


--------------------next---------------------

阅读(625) | 评论(0) | 转发(0) |
0

上一篇:刚刚看到的。

下一篇:SleepEx的WIN实现。

给主人留下些什么吧!~~