| title | Enable the Lock Pages in Memory Option (Windows) | |
|---|---|---|
| description | Learn how to turn on the Lock pages in memory option. See how it can boost performance by keeping data in physical memory instead of paging it to disk. | |
| author | rwestMSFT | |
| ms.author | randolphwest | |
| ms.date | 10/31/2025 | |
| ms.service | sql | |
| ms.subservice | configuration | |
| ms.topic | how-to | |
| helpviewer_keywords |
|
[!INCLUDE SQL Server]
This Windows policy determines which accounts can use a process to keep data in physical memory, preventing the system from paging the data to virtual memory on disk.
Note
Locking pages in memory might boost performance when paging memory to disk is expected. For more information, see Lock pages in memory (LPIM).
A system administrator can enable this policy for the [!INCLUDE ssNoVersion] service account with the Windows Group Policy tool (gpedit.msc), or with SQL Server Configuration Manager in [!INCLUDE sssql19-md] and later versions.
-
On the Start menu, select Run. In the Open box, type
gpedit.msc. The Group Policy dialog box opens. -
On the Local Group Group Policy console, expand Computer Configuration.
-
Expand Windows Settings.
-
Expand Security Settings.
-
Expand Local Policies.
-
Select the User Rights Assignment folder. The policies are displayed in the details pane.
-
In the pane, scroll to and double-click the Lock pages in memory policy.
-
In the Local Security Policy Setting dialog box, select Add User or Group.... Add the [!INCLUDE ssDE] service account or its service security identifier (SID). To determine the service account or the service SID for an instance of [!INCLUDE ssNoVersion], refer to the SQL Server Configuration Manager or use the
service_accountcolumn insys.dm_server_services. For more information, see sys.dm_server_services. -
Select OK.
-
Restart the instance for this setting to take effect.
We recommend that you assign the Lock pages in memory policy to the service SID of the [!INCLUDE ssDE] service. This ensures that the grant remains even if you change the service account of the [!INCLUDE ssDE] service. For more information, see Using Service SIDs to grant permissions to services in SQL Server.