Lock pages in memory

Tech-Archive recommends: Fix windows errors by optimizing your registry



We're have a process using AWE, hence requiring the priviledge to lock pages
in memory. We wish to prevent the entire process address space from being
paged out, not just AWE allocated memory.

We call:

LookupPrivilegeValue(NULL, SE_LOCK_MEMORY_NAME, ...)
AdjustTokenPrivileges(...)

to set the SE_LOCK_MEMORY_NAME privilege (as documented in AWE code example
on MSDN).

My understanding is this just sets the security privilege, and the AWE call
to AllocateUserPhysicalPages() itself will lock those allocated pages in
memory?

Therefore, this implies that the remainder of the process (non AWE wise) is
available to be paged out as normal (observed behaviour).

So, my question is: how do we request that the entire process address space
is locked in memory and prevented from being paged out?

I've found some documentation on a call to NtLockVirtualMemory() at
http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/Memory%20Management/Virtual%20Memory/NtLockVirtualMemory.html.

Is this the required approach, and applicable to 2003 Server Enterprise
Edition?

Thanks,

Simon

.



Relevant Pages

  • Re: AWE in SQL Cluster
    ... lock pages in memory right) the account must log out and back in. ... nodes and run the following commands to setup the AWE memory. ...
    (microsoft.public.sqlserver.clustering)
  • AWE in SQL Cluster
    ... I have a two node cluster with SQL Server 2005 that I am having difficulty ... and run the following commands to setup the AWE memory. ... Address Windowing Extensions requires the 'lock pages in memory' ...
    (microsoft.public.sqlserver.clustering)
  • Re: SQL 2005
    ... lock pages in memory is required for service account. ... If you want SQL Server to be able to address memory though AWE, ...
    (microsoft.public.sqlserver.setup)
  • Re: Cannot get AWE to work in SQL Server 2000 SP3
    ... AWE & Lock pages will reserve that memory so nothing other than SQL Server can touch it anyway. ...
    (microsoft.public.sqlserver.setup)
  • Re: 8 GB of RAM installed
    ... The Account which starts the SQL Service must have the privilege "lock ... pages in memory" - you can set this in the local policy settings ...
    (microsoft.public.sqlserver.server)