Large-page support enables server applications to establish large-page memory regions, which is particularly
useful on 64-bit Windows. Each large-page translation uses a single translation buffer inside the CPU. The size of
this buffer is typically three orders of magnitude larger than the native page size; this increases the efficiency
of the translation buffer, which can increase performance for frequently accessed memory.
To use large-page support, do the following:
- Obtain the SeLockMemoryPrivilege privilege by calling the
AdjustTokenPrivileges function. For more
information, see Changing Privileges in a
Token.
- Retrieve the minimum large-page size by calling the
GetLargePageMinimum function.
- Include the MEM_LARGE_PAGES value when calling the
VirtualAlloc function. The size and alignment must be a
multiple of the large-page minimum.
When writing applications that use large-page memory, keep the following considerations in mind:
- Large-page memory regions may be difficult to obtain after the system has been running for a long time because the physical space for each large page must be contiguous, but the memory may have become fragmented. Allocating large pages under these conditions can significantly affect system performance. Therefore, applications should avoid making repeated large page allocations and allocate them all one time at startup instead.
- The memory is always read-write and nonpageable (always resident in physical memory).
- The memory is part of the process private bytes but not part of the working set, because the working set by definition contains only pageable memory.
- Large-page allocations are not subject to job limits.
- WOW64 on Intel Itanium-based systems does not support 32-bit applications that use this feature. The
applications should be recompiled as native 64-bit applications.
Send comments about this topic to Microsoft
Build date: 7/2/2009