# locked pages in memory

> Windows right that stops the OS paging the Database Engine's buffer pool memory to disk.

Source: https://sqlly.app/sql-configuration/sql-server/locked-pages-in-memory
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).

**Default**

`Not granted`

**Range**

Granted or not granted

**Restart needed**

No

**Default checked on**

SQL Server 2025

## What it does

With the Lock pages in memory right granted, SQL Server locks the pages its memory manager allocates, and the OS cannot page them out. LPIM does not stop SQL Server releasing memory on request, and max server memory still caps what it locks; Microsoft strongly recommends setting that upper limit before granting the right. On Linux the privilege does not exist: mssql-conf memory.memorylimitmb is the way to bound the process there.

## Default value

`Not granted`. Windows only. sys.dm_os_sys_info.sql_memory_model_desc reports CONVENTIONAL, LOCK_PAGES or LARGE_PAGES (SQL Server 2016 SP1 and later).

## Check the current value

```
SELECT sql_memory_model_desc FROM sys.dm_os_sys_info;

-- nonzero rows mean pages are actually locked
SELECT memory_node_id, locked_page_allocations_kb
FROM sys.dm_os_memory_nodes
WHERE locked_page_allocations_kb > 0;
```

## Change it

```
-- Windows: Local Security Policy, Local Policies, User Rights Assignment,
-- Lock pages in memory: add the Database Engine service SID, which keeps the grant
-- across service account changes; then restart the instance
```

No sp_configure here either. Grant the Lock pages in memory right to the service account or its service SID in Local Security Policy, or use SQL Server Configuration Manager (SQL Server 2019 and later), then restart the instance.

## When to change it

Only on Windows servers that have really been paged out: SQL Server working set trims or PAGEIOLATCH bursts while Available MBytes still looks healthy. Set max server memory first, and do not grant it as a routine speedup.

## What can go wrong

Locked pages cannot be reclaimed, so without a firm max server memory the instance can lock away RAM until the OS starves and the box hangs. Set the ceiling first and leave the OS and other processes room, and remember a service SID grant survives service account changes, so audit it rather than assume it is fresh.

## Questions about locked pages in memory

### What is the default value of locked pages in memory in SQL Server?

Not granted. Windows only. sys.dm_os_sys_info.sql_memory_model_desc reports CONVENTIONAL, LOCK_PAGES or LARGE_PAGES (SQL Server 2016 SP1 and later).

### Does changing locked pages in memory require a restart?

No. No sp_configure here either. Grant the Lock pages in memory right to the service account or its service SID in Local Security Policy, or use SQL Server Configuration Manager (SQL Server 2019 and later), then restart the instance.

### When should I change locked pages in memory?

Only on Windows servers that have really been paged out: SQL Server working set trims or PAGEIOLATCH bursts while Available MBytes still looks healthy. Set max server memory first, and do not grant it as a routine speedup.

Back to all [SQL Server settings](https://sqlly.app/sql-configuration/sql-server), or check the [SQL Server manual](https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/server-configuration-options-sql-server) for every option.

## Related SQL Server settings

- [`max server memory (MB)` Upper limit on the memory SQL Server's memory manager takes, buffer pool included.](https://sqlly.app/sql-configuration/sql-server/max-server-memory)
- [`min server memory (MB)` Memory SQL Server will not release back to the OS once it has acquired it.](https://sqlly.app/sql-configuration/sql-server/min-server-memory)

## Related on SQLly

- [Memory pressure Performance guide](https://sqlly.app/sql-performance/memory-pressure)
- [SQL Server query performance troubleshooting Performance guide](https://sqlly.app/sql-performance/sql-server)
