{"id":771,"date":"2026-09-19T23:05:50","date_gmt":"2026-09-19T23:05:50","guid":{"rendered":"https:\/\/windows-vps.org\/blog\/?p=771"},"modified":"2026-09-19T23:05:50","modified_gmt":"2026-09-19T23:05:50","slug":"sql-server-2025-max-server-memory-lock-pages-small-instances","status":"publish","type":"post","link":"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/","title":{"rendered":"SQL Server 2025 Memory Configuration on Small Windows Instances: max server memory and Lock Pages"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">SQL Server&#8217;s default memory behaviour is designed for a machine that does nothing else, and on a shared Windows instance that default is the fastest route to a swapping, unresponsive server. SQL Server 2025 will happily grow its buffer pool until the operating system starts paging, at which point IIS, RDP, and even the SQL Server worker threads contend for what remains. The fix is a specific number, not a checkbox, and the number depends on what else the box runs.<\/p>\n\n\n\n<h2 class=\"wp-element-heading wp-block-heading\">Why the Default 2,147,483,647 Is Not a Limit<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>max server memory (MB)<\/code> defaults to an effectively unlimited value. It caps only the buffer pool, compiled plan cache, and related internal caches &mdash; not CLR memory, not extended stored procedures, not the thread stacks themselves. Setting it does not guarantee the process stays under the figure, so budget headroom rather than treating it as a hard ceiling.<\/p>\n\n\n\n<h2 class=\"wp-element-heading wp-block-heading\">Sizing Table for Common Instance Profiles<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Total RAM<\/th><th>SQL-plus-IIS host<\/th><th>SQL-only host<\/th><th>OS reserve<\/th><\/tr><\/thead><tbody><tr><td>8 GB<\/td><td>4,608 MB<\/td><td>5,632 MB<\/td><td>1,024 MB + IIS 2&nbsp;GB<\/td><\/tr><tr><td>16 GB<\/td><td>9,216 MB<\/td><td>11,264 MB<\/td><td>1,536 MB + IIS 4&nbsp;GB<\/td><\/tr><tr><td>32 GB<\/td><td>18,432 MB<\/td><td>23,552 MB<\/td><td>2,048 MB + IIS 8&nbsp;GB<\/td><\/tr><tr><td>64 GB<\/td><td>36,864 MB<\/td><td>47,104 MB<\/td><td>4,096 MB + IIS 12&nbsp;GB<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The OS reserve grows with total RAM because Windows kernel structures, driver pools, and the file system cache scale with physical memory and connection counts, not with a fixed constant. On anything above 32&nbsp;GB, a 10% reserve is the floor, not a target.<\/p>\n\n\n\n<h2 class=\"wp-element-heading wp-block-heading\">Lock Pages in Memory: When It Helps and When It Hurts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Lock Pages in Memory right prevents SQL Server&#8217;s buffer pool from being paged to disk. On a dedicated host with plenty of RAM, it stabilises latency and is enabled by default for SQL Server on Linux. On a small Windows instance shared with other workloads it is a trade: locked pages cannot be reclaimed under pressure, so a memory-hungry mail filter or badly-behaved app pool will push the whole machine into a harder failure instead of degrading gracefully.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Enable it<\/strong> on dedicated SQL hosts with 16&nbsp;GB or more, where the buffer pool is the dominant consumer.<\/li><li><strong>Leave it off<\/strong> on 8&nbsp;GB shared instances combining IIS and SQL, where flexibility is worth more than peak buffer-pool stability.<\/li><li><strong>Grant the right<\/strong> via <code>secpol.msc<\/code> &rarr; Local Policies &rarr; User Rights Assignment, or a GPO at scale. Confirm with the <code>sys.dm_os_sys_memory<\/code> DMV after restart, checking that <code>locked_page_allocations_kb<\/code> is non-zero.<\/li><li><strong>Do not enable it without also setting <code>max server memory<\/code>.<\/strong> Locking pages with no cap is how an instance consumes the entire machine.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-element-heading wp-block-heading\">Tempdb and File Sizing<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Tempdb defaults to autogrowth of 64&nbsp;MB, which means a busy reporting query can trigger dozens of growth events with their attendant latency spikes. Pre-size data and log files to expected working size and set growth to a fixed MB value:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev,  SIZE = 2048MB, FILEGROWTH = 256MB);\nALTER DATABASE tempdb MODIFY FILE (NAME = templog,  SIZE = 512MB,  FILEGROWTH = 128MB);\nALTER DATABASE tempdb MODIFY FILE (NAME = tempdev2, SIZE = 2048MB, FILEGROWTH = 256MB);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use one tempdb data file per four to eight logical cores, with the first file sized so all are equal. Instant file initialisation removes the zeroing cost on grow, and trace flag 1118 &mdash; once a manual requirement for mixed-extent contention &mdash; is now the default on SQL Server 2025 and should not be set explicitly.<\/p>\n\n\n\n<h2 class=\"wp-element-heading wp-block-heading\">Verify, Then Leave It Alone<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Confirm the effective configuration and watch pressure over a full business cycle rather than a quiet afternoon:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT name, value_in_use FROM sys.configurations\nWHERE name IN ('max server memory (MB)','min server memory (MB)');\n\nSELECT total_physical_memory_kb\/1024 AS phys_mb,\n       available_physical_memory_kb\/1024 AS avail_mb,\n       system_memory_state_desc\nFROM sys.dm_os_sys_memory;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Persistent <code>system_memory_state_desc<\/code> values of &quot;Physical memory is low&quot; mean the cap is too high for the working set, not too low. Pair this with the host-level counters described in <a href=\"https:\/\/windows-vps.org\/\">the Windows performance monitoring guides<\/a> so you catch paging before users do.<\/p>\n\n\n\n<h2 class=\"wp-element-heading wp-block-heading\">Reading Memory Pressure Correctly<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The misleading counter is SQL Server&#8217;s own Total Server Memory, which will happily sit near your cap in a healthy system because a large buffer pool is the goal, not a symptom. Watch the host side instead: Pages\/sec sustained above 100 to a disk-backed pagefile, or Available MBytes below the OS reserve, is real pressure. On a virtualised instance also check the hypervisor&#8217;s ballooning or swapping counters, since a host-level memory squeeze produces SQL Server latency spikes that look internal and are not. Correlating SQL waits with host memory state is the difference between tuning the database and fixing the machine.<\/p>\n\n\n\n<h2 class=\"wp-element-heading wp-block-heading\">A Worked Example at 16 GB<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Take a single hosted instance running IIS and SQL Server 2025 on 16&nbsp;GB. Reserve 1,536&nbsp;MB for the OS, and if web traffic peaks around eight worker processes, budget roughly 4&nbsp;GB for IIS and its app pools. That leaves about 10&nbsp;GB, so set <code>max server memory<\/code> to 9,216&nbsp;MB and leave min server memory at its default. Pre-size tempdb to 2&nbsp;GB across two files, set growth to 256&nbsp;MB, and keep Lock Pages in Memory off so the OS can reclaim under pressure. Watch Available MBytes and Pages\/sec over a full week; if Available never dips near the reserve and paging stays flat, the split is right. If SQL Server regularly reports physical memory low while host counters look calm, the cap is too aggressive for the buffer pool&#8217;s working set and should be raised by 1&nbsp;GB at a time rather than slashed.<\/p>\n\n\n\n<h2 class=\"wp-element-heading wp-block-heading\">The Shared-Instance Decision<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Running IIS and SQL Server on the same instance is economical and perfectly workable under roughly 16&nbsp;GB, provided you cap the buffer pool generously for the OS and the app pools. Above that threshold the coupling costs more than the consolidation saves, because a single noisy query can degrade web response times with no obvious cause. For teams that need clean separation, splitting web and database across two <a href=\"https:\/\/windows-vps.org\/\">hosted Windows instances<\/a> on a private network removes the contention entirely and makes each side independently sized.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whatever the topology, set the cap first, size tempdb second, and only then consider Lock Pages in Memory. Doing it in that order prevents the most common failure mode, where a locked and uncapped buffer pool slowly starves every other service on the machine.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Size SQL Server 2025 max server memory on 8-16 GB Windows instances, decide on Lock Pages in Memory, and configure tempdb and buffer pool without starving IIS or the OS.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-771","post","type-post","status-publish","format-standard","hentry","category-tutorials-guides"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL Server 2025 Memory Configuration on Small Windows Instances: max server memory and Lock Pages - Windows VPS Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server 2025 Memory Configuration on Small Windows Instances: max server memory and Lock Pages\" \/>\n<meta property=\"og:description\" content=\"SQL Server 2025 Memory Configuration on Small Windows Instances: max server memory and Lock Pages\" \/>\n<meta property=\"og:url\" content=\"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/\" \/>\n<meta property=\"og:site_name\" content=\"Windows VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-19T23:05:50+00:00\" \/>\n<meta name=\"author\" content=\"windows-vps\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"windows-vps\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/\",\"url\":\"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/\",\"name\":\"SQL Server 2025 Memory Configuration on Small Windows Instances: max server memory and Lock Pages - Windows VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\"},\"datePublished\":\"2026-09-19T23:05:50+00:00\",\"author\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\"},\"breadcrumb\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/windows-vps.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server 2025 Memory Configuration on Small Windows Instances: max server memory and Lock Pages\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\",\"url\":\"https:\/\/windows-vps.org\/blog\/\",\"name\":\"Windows VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/windows-vps.org\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\",\"name\":\"windows-vps\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"caption\":\"windows-vps\"},\"sameAs\":[\"https:\/\/windows-vps.org\/blog\"],\"url\":\"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL Server 2025 Memory Configuration on Small Windows Instances: max server memory and Lock Pages - Windows VPS Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server 2025 Memory Configuration on Small Windows Instances: max server memory and Lock Pages","og_description":"SQL Server 2025 Memory Configuration on Small Windows Instances: max server memory and Lock Pages","og_url":"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/","og_site_name":"Windows VPS Blog","article_published_time":"2026-09-19T23:05:50+00:00","author":"windows-vps","twitter_card":"summary_large_image","twitter_misc":{"Written by":"windows-vps","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/","url":"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/","name":"SQL Server 2025 Memory Configuration on Small Windows Instances: max server memory and Lock Pages - Windows VPS Blog","isPartOf":{"@id":"https:\/\/windows-vps.org\/blog\/#website"},"datePublished":"2026-09-19T23:05:50+00:00","author":{"@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58"},"breadcrumb":{"@id":"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/windows-vps.org\/blog\/sql-server-2025-max-server-memory-lock-pages-small-instances\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/windows-vps.org\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL Server 2025 Memory Configuration on Small Windows Instances: max server memory and Lock Pages"}]},{"@type":"WebSite","@id":"https:\/\/windows-vps.org\/blog\/#website","url":"https:\/\/windows-vps.org\/blog\/","name":"Windows VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/windows-vps.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58","name":"windows-vps","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","caption":"windows-vps"},"sameAs":["https:\/\/windows-vps.org\/blog"],"url":"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/"}]}},"_links":{"self":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/comments?post=771"}],"version-history":[{"count":1,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/771\/revisions"}],"predecessor-version":[{"id":772,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/771\/revisions\/772"}],"wp:attachment":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/media?parent=771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/categories?post=771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/tags?post=771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}