
{"id":7257,"date":"2021-07-15T12:43:04","date_gmt":"2021-07-15T12:43:04","guid":{"rendered":"https:\/\/rax-stg-wp-aws.com\/blogs\/handle-memory-pressure-alerts-from-memory-optimized-tables-in-sql-server\/"},"modified":"2026-11-03T19:28:20","modified_gmt":"2026-11-03T19:28:20","slug":"handle-memory-pressure-alerts-from-memory-optimized-tables-in-sql-server","status":"publish","type":"blogs","link":"https:\/\/www.rackspace.com\/en-gb\/blogs\/handle-memory-pressure-alerts-from-memory-optimized-tables-in-sql-server\/","title":{"rendered":"Handle memory pressure alerts from memory-optimized tables in SQL Server"},"content":{"rendered":"<p><strong>Introduction<\/strong><\/p>\n<p>The Microsoft SQL Server is very smart in terms of memory management, but sometimes memory pressure alerts and database engines demand more memory, leading to errors.&nbsp;This post discusses how to resolve one of the exceptional scenarios you might<br \/>\nexperience because of memory pressure on SQL Server\u00ae; 2019 (Enterprise Edition)\u00ae caused by the memory-optimized tables (In-memory Online transaction processing (OLTP)). The same steps apply to SQL Server 2014 and later.<\/p>\n<p>You might see the following error messages flash on your screen:<\/p>\n<p><em>&nbsp; &nbsp; Message: MSSQL on Windows: Stolen Server Memory is too high<br \/>\n&nbsp; &nbsp; Source: XXXXX\\MSSQLSERVER Path: Not Present Alert<br \/>\n&nbsp; &nbsp; description: SQL instance &#8220;MSSQLSERVER&#8221; Stolen Server Memory on<br \/>\n&nbsp; &nbsp; computer &#8220;XXXXXXX.XXX.com&#8221; is too high.<\/em><\/p>\n<p><em>&nbsp; &nbsp; Message: SQL Server Alert System: &#8216;Severity 17&#8217; occurred on \\\\XXXXXXX<br \/>\n&nbsp; &nbsp; DESCRIPTION: &nbsp; There is insufficient system memory in resource pool &#8216;internal&#8217;<br \/>\n&nbsp; &nbsp; to run this query.<\/em><\/p>\n<p><em>&nbsp; &nbsp; Message: Disallowing page allocations for database &#8216;InMemoryDB&#8217; due to<br \/>\n&nbsp; &nbsp; insufficient memory in the resource pool &#8216;default&#8217;. See<br \/>\n&nbsp; &nbsp; &#8216;http:\/\/go.microsoft.com\/fwlink\/?LinkId=510837&#8217; for more information.<\/em><\/p>\n<p><em>&nbsp; &nbsp; Message: XTP failed page allocation due to memory pressure: FAIL_PAGE_ALLOCATION 32<\/em><br \/>\n&nbsp;<\/p>\n<p><strong>Solution<\/strong><\/p>\n<p><strong>The first step is to check the memory consumption in the SQL buffer pool.<\/strong><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26341-body-Picture1_5.png\" alt=\"memory pressure pic 1\" \/><\/p>\n<p>As you can see from the preceding image, the database in question, <strong>InMemoryDB<\/strong>, consumes only 0.017% of the buffer pool.<\/p>\n<p><strong>Step two<\/strong><\/p>\n<p>Then you check the OS Memory Clerks using the following T-SQL command:<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <em>&nbsp;&nbsp;select * from sys.dm_os_memory_clerks order by pages_kb desc<\/em><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26341-body-Picture2_1.png\" alt=\"memory pressure pic 2\" \/><\/p>\n<p>The results show that the total of top consumers was around 80% of the totalmaximum server memory.The size of the memory-optimized tables is also less than 2 GB, which you can see in the preceding image for the name, **DB_ID_6**. As such, ideally, there should not be any memory pressure on the server.<\/p>\n<p><strong>Step three<\/strong><\/p>\n<p>After reviewing the Out of Memory (OOM) links mentioned in the error log,<strong>http:\/\/go.microsoft.com\/fwlink\/?LinkId=510837<\/strong>, you need to bind the databasewith memory-optimized tables to a resource pool. This binding is a best practicefor databases with memory-optimized tables. Follow the steps to create a resource pool in the resource governor and bind the database.<\/p>\n<p>Best practices recommend that you protect SQL Server from having its resources&nbsp;consumed by one or more memory-optimized tables and prevent other memory users&nbsp;from consuming memory needed by memory-optimized tables. Therefore, you should<br \/>\ncreate a separate resource pool to manage memory consumption for the database with memory-optimized tables.<\/p>\n<p><strong>&nbsp;&nbsp;Steps to bind to a resource pool<\/strong><\/p>\n<p>Step 1. Create Resource Pool with the Memory allocations:<\/p>\n<p>&nbsp; <em>&nbsp;USE [master]<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;GO<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp;CREATE RESOURCE POOL [Admin_Pool] WITH(min_cpu_percent=0,&nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; max_cpu_percent=100,&nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min_memory_percent=15,&nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; max_memory_percent=15,&nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cap_cpu_percent=100,&nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AFFINITY SCHEDULER = AUTO,<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min_iops_per_volume=0,<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; max_iops_per_volume=0)<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;GO<\/em><br \/>\n<strong>Note<\/strong>: To avoid out-of-memory conditions, the values for <strong>min_memory_percent<\/strong>&nbsp;and <strong>max_memory_percent<\/strong>&nbsp;should be the same. In this case, the memory-optimized tables are very small, with 15% of the&nbsp;total server memory allocated to the resource pool. Don&#8217;t forget to use the&nbsp;links in the references to calculate the percent of memory in your environment.<\/p>\n<p>In this case, the memory-optimized tables are very small, with 15% of the total server memory allocated to the resource pool. Don&#8217;t forget to use the&nbsp;&nbsp; &nbsp;links in the references to calculate the percent of memory in your environment.<\/p>\n<p><strong>Step 2:&nbsp;<\/strong>Verify the resource pool and bind the database to it:<\/p>\n<p><em>&nbsp; EXEC sp_xtp_bind_db_resource_pool &#8216;InMemoryDB&#8217;, &#8216;Admin_Pool&#8217; &nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;GO<\/em><\/p>\n<p>\n<em>3. <\/em>Verify the bind in <strong>sys.databases<\/strong>:<\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp;SELECT d.database_id, d.name, d.resource_pool_id &nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;FROM sys.databases d<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;GO<\/em><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26341-body-Picture3_0.png\" alt=\"sql pressure pic 3\" \/><\/p>\n<p><strong>Step 4<\/strong>. Restart the database to make the binding active:<\/p>\n<p>\n<em>&nbsp; &nbsp; &nbsp; &nbsp;ALTER DATABASE DB_Name SET OFFLINE &nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;GO &nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;ALTER DATABASE DB_Name SET ONLINE &nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;GO &nbsp;&nbsp;<\/em><\/p>\n<p><strong>Note<\/strong>: If the database is always on, perform the steps on both the nodes, and instead of Step 4 (restart databases), perform a database failover to thesecondary instance.<\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p>In this case, all alerts related to memory pressure stopped after adding the databases with memory-optimized tables to the resource pool. I monitored the SQL Server error logs for a couple of weeks for this particular issue, and there were no traces of any memory pressure. These steps helped fix the memory pressure onthe database engine level with minimal downtime.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Handle memory pressure alerts from memory-optimized tables in SQL Server<\/p>\n","protected":false},"author":2,"featured_media":7259,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"content-type":"","nid":"26341","content_type":"blog","created_by":"10130","authored_on":"2023-12-05T15:07:07+00:00","field_article_industries":"","tag_category":"Technical","field_blog_author_text":"by Rackspace Technology Staff","seo_description":"Learn to handle memory pressure alerts caused by memory-optimized tables in SQL Server. Find solutions for exceptional scenarios in SQL Server 2019+.\r\n","field_featured_image":"","insights_image":"\/wp-content\/uploads\/2026\/blog_technical_images\/26341-insights_image-database-technical-blog-2-insights.jpg","field_partners":"","rxt_platforms":"","product":"Microsoft SQL","publisheddate":"2021-07-15T12:43:04","rxt_solutions":"Cloud Management & Operations, Cloud Optimization","opengraph_tag":"","x_tag":"","teaser_flag":"Technical Blog","seo_titile":"SQL Server Memory Pressure Alerts | Rackspace Technology","field_topics":"","field_slug":"handle-memory-pressure-alerts-from-memory-optimized-tables-in-sql-server","footnotes":""},"categories":[178],"tags":[204],"class_list":["post-7257","blogs","type-blogs","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-technical"],"_links":{"self":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/7257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs"}],"about":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/types\/blogs"}],"author":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/comments?post=7257"}],"version-history":[{"count":2,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/7257\/revisions"}],"predecessor-version":[{"id":9275,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/7257\/revisions\/9275"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media\/7259"}],"wp:attachment":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media?parent=7257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/categories?post=7257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/tags?post=7257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}