Large-Page Support - Win32 apps (original) (raw)

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.

The following procedure describes how to use large-page support.

To use large-page support

  1. Obtain the SeLockMemoryPrivilege privilege by calling the AdjustTokenPrivileges function. For more information, see Assigning Privileges to an Account and Changing Privileges in a Token.
  2. Retrieve the minimum large-page size by calling the GetLargePageMinimum function.
  3. 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: