Understanding Stolen and Foreign Memory Usage Between Two SQL Server Database Servers

memorysql serversql server 2014sql-server-2012

Below is more for my understanding on how to interpret the data from my perfmon counters for 2 database servers with diff app structure but sort of similar workload

Server A has total of 1 TB RAM with databases of approx 10 TB with
below metrics via 4 NUMA node config

enter image description here

Server B has total of 1 TB RAM with databases of approx 16 TB with
below metrics via 4 NUMA node config

enter image description here

Server B has more MAX memory assigned to it due to size of databases being large out there. Yes i know MAX memory settings can be improved little better, but would plan later if i can understand above numbers better for stolen and foreign memory.

What do those numbers tell me as i see foreign memory seems to be approx 50 GB for one server and stolen being 150 GB on other server where foreign just seems to be 5 GB.

Sorry for my lack of knowledge here, but can someone guide on better way to interpret this data and what possible changes one can think of tweaking here?

Best Answer

Stolen memory refers to memory that is being used for something other than buffer, that could be used for buffer if it weren't being used for something else. See why SQL Server 2012 still needs the "Stolen Server Memory (KB). To minimize the amount of stolen memory, one would need to optimize queries so that they use as little memory as possible. For example, if there is an unnecessary sort, that may use some of this memory. If it's a reporting server, my guess is you're just going to have to account for some amount of stolen memory.

Foreign memory refers to worker memory that is on a remote NUMA node. See How It Works: SQL Server (NUMA Local, Foreign and Away Memory Blocks). When memory is foreign it takes a bit longer to access it, and the impact depends on your system and the speed of the components. To minimize, you would want to make sure you have the NUMA configuration and Max Degree of Parallelism set correctly.