SlideShare uma empresa Scribd logo
1 de 29
By
Susantha Bathige
MINDING SQL SERVER MEMORY
AGENDA
• Introduction
• 32 bit vs 64 bit
• Terminology
• Memory support in Windows
• SQL Server Memory
PHYSICAL MEMORY
• RAM (system memory, main memory, primary storage)
• DIMM’s
• Measured in MB or GB
• Faster access (5-12GB/sec)
• Volatile
• Expensive
• Windows Server 2008 R2 Datacenter and Enterprise Editions can now support systems
with 2TB of RAM
VIRTUAL ADDRESS SPACE (VAS)
• Mechanism to share the limited physical memory among the processes
• Set of addresses that the processor uses to access anything on its bus
• Some are reserved for
• Video RAM
• HW buffers, etc.
• 32-bit w/o PAE, the address bus is 32 bits (4GB)
• 32-bit Intel server processors with PAE, the address bus was 36 bits (64GB)
• Limit address bus to 44 bits on 64-bit (16TB)
VAS
Source : Professional SQL Server® 2008 Internals and Troubleshooting
• Address space is limited to 4GB
• /3GB switch increases the user mode VAS to 3GB
• /PAE Switch
• Intel technology
• Increases address bus to 36bits
• Up to 64GB or 128GB of RAM
• Theoretical limit is 18,446,744,073,709,551,616 Bytes
• 16 exabytes =
16,777,216 petabytes (16 million PB)
17,179,869,184 terabytes (17 billion TB)
17,592,186,044,416 gigabytes (17 trillion GB)
• Practical limitation – 44 bits address bus (16TB)
• Enough address space for the foreseeable future
• Logically it's split into an 8TB range for user mode and 8TB for kernel mode
VIRTUAL MEMORY MANAGER (VMM)
• Joins physical memory and virtual address space together
Source : Professional SQL Server® 2008 Internals and Troubleshooting
TERMINOLOGY
• Processes
• essentially container that hosts the execution of an executable image file
• process has a virtual address space that holds the process’s private and shared data
• Threads
• a process includes one or more threads that actually execute the code in the process
• PTE
• OS mechanism of mapping VAS to physical memory page
• Page file
• a disk file that the computer uses to increase the amount of physical storage for
virtual memory
TERMINOLOGY
• Reserved memory/MemToLeave
• applications reservations to create a large block of VM. only in the startup process in 32-
bit SQL Server
• Current commit charge
• amount of committed virtual memory for all the active processes. RAM size is the max limit
• Page fault
• writes the data from page file into memory
• Soft page faults
• occur when a new page of memory is required (VirtualAlloc)
• Hard page faults
• occurs when SQL Server tries to access a page of its memory that has been paged out to
the page file
TERMINOLOGY…
• Private bytes
• bytes allocated exclusively for a specific process
• Committed memory / Working Set
• the shared and private bytes allocated to a process backed by RAM. reflects the
physical memory usage of a process
• Paged pool
• windows can write the data it stores to the paging file
• Non-paged pool
• the kernel and device drivers use non-paged pool to store data that might be
accessed when the system can’t handle page faults
SQL SERVER MEMORY
• Three levels (bottom to top)
• Memory nodes
• Memory clerks, cache stores
• Memory objects
• Only memory clerks can access memory
• Create new memory clerks if want to allocate more memory
MEMORY NODES
• DMVs
• sys.dm_os_memory_nodes
• More memory nodes if NUMA enabled
• Each memory node has its own memory clerks and caches
• Total usage is calculated using the sum of all the nodes
MEMORY CLERKS, CACHES, AND THE BUFFER
POOL
• Clerks
• DMV - sys.dm_os_memory_clerks
• MEMORYCLERK_SQLGENERAL
• MEMORYCLERK_SQLQUERYPLAN
• Troubleshooting much easier
• Cache
• object store, cache store, user store
• DMV - sys.dm_os_memory_cache_counters
• Buffer pool
• manage data cache
• DMV - sys.dm_os_buffer_descriptors
PLAN CACHE
• Cache all the execution plans
• DMV - sys.dm_exec_cached_plans
• Look for the procedure cache option in DBCC MEMORYSTATUS
PLAN CACHE IN A PROD SERVER
• What is Adhoc?
• Use of DBCC FREESYSTEMCACHE('SQL Plans')
QUERY MEMORY/WORKSPACE MEMORY
• Used to temporarily store results during hash and sort operations
• Allocated out of the buffer pool
• DMV – sys.dm_exec_query_memory_grants
• Perfmon counters
• Granted Workspace Memory (KB)
• Maximum Workspace Memory (KB)
• Memory Grants Pending
• Memory Grants Outstanding
• RESOURCE_SEMAPHORE wait type
• Demo
MIN AND MAX SERVER MEMORY
• Control only buffer pool size
• Min
• min physical memory try to keep committed
• when the SQL Server service starts, it does not acquire all the memory configured in
Min
• Max
• when the SQL Server service starts, it does not acquire all the memory configured in
Max
• a "ceiling" for the buffer pool
• Can be used “sp_configure” to set
AWE ENABLED OPTION
• In SQL Server 2008 R2
• SQL Server process needs to have the "Lock Pages in Memory" Advanced
User Right in Windows
• Only data pages can be stored in AWE mapped memory
AWE ENABLED OPTION
• Deprecated in SQL Server 2008 R2
• SQL Server 2012, this configuration option and the feature that uses this configuration
option are removed from the product (32 bit and 64 bit)
Source : http://support.microsoft.com/default.aspx?scid=kb;EN-US;2644592
LPIM
• AWE APIs to allocate and map physical memory to process address space
• OS never paged out AWE API allocated memory
• "Lock Pages In Memory“ right need to be granted
• Simplified in SQL Server 2012 (32 bit and 64 bit)
• Need to revisit the “max/min server memory”
• Not be part of the working set
• Overall system performance is a concern due to memory starvation
LPIM RIGHT AND SQL SERVER
Source : http://support.microsoft.com/kb/2659143
IS LPIM ENABLED?
• use sys.dm_os_memory_nodes, sys.dm_os_nodes dmvs
• Memory Manager section of DBCC MEMORYSTATUS
• Current SQL Server Error log
Using
locked pages
in the memory manager
WINDOWS MAX MEMORY?
• Why 2TB maximum limitation on Windows?
• Windows Server 2008 Datacenter support maximum
• Not h/w limitation
• Testing limitation
•
CHANGES IN SQL SERVER 2012
• memory allocation is controlled by the max server memory (MB) and min server memory
(MB) configuration options.
Source : http://support.microsoft.com/default.aspx?scid=kb;EN-US;2663912
CHANGES IN SQL SERVER 2012
• Changes to "memory_to_reserve“
Source : http://support.microsoft.com/default.aspx?scid=kb;EN-US;2663912
PERFMON COUNTERS
• Process: Page Faults / sec
• Memory/Pool Paged Bytes
• Memory/Pool Nonpaged Bytes
• MemoryFree System Page Table
REFERENCES
• http://support.microsoft.com/default.aspx?scid=kb;EN-US;2644592
• http://support.microsoft.com/kb/2659143
• http://blogs.msdn.com/b/slavao/archive/2005/04/29/413425.aspx
• http://sqlblog.com/blogs/sqlos_team/archive/2012/06/20/sql-server-2012-memory-manager-kb-articles.aspx
• http://msdn.microsoft.com/en-us/library/aa175282(v=sql.80).aspx
• Book: Professional SQL Server® 2008 Internals and Troubleshooting
• Whitepaper - "Advances in Memory Management in Windows"
Q & A

Mais conteúdo relacionado

Mais procurados

Novedades SQL Server 2014
Novedades SQL Server 2014Novedades SQL Server 2014
Novedades SQL Server 2014netmind
 
Tuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadTuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadMarius Adrian Popa
 
SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4Gianluca Hotz
 
TechEvent 2019: DB, CMU and EUS engineering with vagrant; Stefan Oehrli - Tri...
TechEvent 2019: DB, CMU and EUS engineering with vagrant; Stefan Oehrli - Tri...TechEvent 2019: DB, CMU and EUS engineering with vagrant; Stefan Oehrli - Tri...
TechEvent 2019: DB, CMU and EUS engineering with vagrant; Stefan Oehrli - Tri...Trivadis
 
InnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter ZaitsevInnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter ZaitsevFuenteovejuna
 
Get More Out of MongoDB with TokuMX
Get More Out of MongoDB with TokuMXGet More Out of MongoDB with TokuMX
Get More Out of MongoDB with TokuMXTim Callaghan
 
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)BT Akademi
 
Building low latency java applications with ehcache
Building low latency java applications with ehcacheBuilding low latency java applications with ehcache
Building low latency java applications with ehcacheChris Westin
 
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusionAdvanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusionColdFusionConference
 
MySQL Storage Engines
MySQL Storage EnginesMySQL Storage Engines
MySQL Storage EnginesKarthik .P.R
 
MySQL Replication Basics
MySQL Replication BasicsMySQL Replication Basics
MySQL Replication BasicsAbdul Manaf
 
SQL Server 2014 Extreme Transaction Processing (Hekaton) - Basics
SQL Server 2014 Extreme Transaction Processing (Hekaton) - BasicsSQL Server 2014 Extreme Transaction Processing (Hekaton) - Basics
SQL Server 2014 Extreme Transaction Processing (Hekaton) - BasicsTony Rogerson
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017Gianluca Hotz
 
Remote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts
 
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheClouds
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheCloudsKoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheClouds
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheCloudsTobias Koprowski
 
Caching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and PitfallsCaching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and PitfallsHARIHARAN ANANTHARAMAN
 
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)Aurimas Mikalauskas
 

Mais procurados (20)

Novedades SQL Server 2014
Novedades SQL Server 2014Novedades SQL Server 2014
Novedades SQL Server 2014
 
Tuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadTuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy Workload
 
SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4
 
TechEvent 2019: DB, CMU and EUS engineering with vagrant; Stefan Oehrli - Tri...
TechEvent 2019: DB, CMU and EUS engineering with vagrant; Stefan Oehrli - Tri...TechEvent 2019: DB, CMU and EUS engineering with vagrant; Stefan Oehrli - Tri...
TechEvent 2019: DB, CMU and EUS engineering with vagrant; Stefan Oehrli - Tri...
 
InnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter ZaitsevInnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter Zaitsev
 
Get More Out of MongoDB with TokuMX
Get More Out of MongoDB with TokuMXGet More Out of MongoDB with TokuMX
Get More Out of MongoDB with TokuMX
 
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)
 
Building low latency java applications with ehcache
Building low latency java applications with ehcacheBuilding low latency java applications with ehcache
Building low latency java applications with ehcache
 
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusionAdvanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusion
 
In Memory OLTP
In Memory OLTP In Memory OLTP
In Memory OLTP
 
MySQL Storage Engines
MySQL Storage EnginesMySQL Storage Engines
MySQL Storage Engines
 
MySQL Replication Basics
MySQL Replication BasicsMySQL Replication Basics
MySQL Replication Basics
 
SQL Server 2014 Extreme Transaction Processing (Hekaton) - Basics
SQL Server 2014 Extreme Transaction Processing (Hekaton) - BasicsSQL Server 2014 Extreme Transaction Processing (Hekaton) - Basics
SQL Server 2014 Extreme Transaction Processing (Hekaton) - Basics
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017
 
Remote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New Features
 
Database storage engines
Database storage enginesDatabase storage engines
Database storage engines
 
5 Reasons to Upgrade Ehcache to BigMemory Go
5 Reasons to Upgrade Ehcache to BigMemory Go5 Reasons to Upgrade Ehcache to BigMemory Go
5 Reasons to Upgrade Ehcache to BigMemory Go
 
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheClouds
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheCloudsKoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheClouds
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheClouds
 
Caching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and PitfallsCaching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and Pitfalls
 
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
 

Destaque

Lecciones aprendidas SQL Server AlwaryOn
Lecciones aprendidas SQL Server AlwaryOnLecciones aprendidas SQL Server AlwaryOn
Lecciones aprendidas SQL Server AlwaryOnJulián Castiblanco
 
Guías y recomendaciones para instalar y configurar clusters de sql server
Guías y recomendaciones para instalar y configurar clusters de sql serverGuías y recomendaciones para instalar y configurar clusters de sql server
Guías y recomendaciones para instalar y configurar clusters de sql serverEnrique Catala Bañuls
 
Novedades en el manejo de Grandes volúmenes de datos con SQL Server 2014
Novedades en el manejo de Grandes volúmenes de datos con SQL Server 2014Novedades en el manejo de Grandes volúmenes de datos con SQL Server 2014
Novedades en el manejo de Grandes volúmenes de datos con SQL Server 2014Enrique Puig
 
Trucos, OptimizacióN Y Buenas PráCticas Para Sql
Trucos, OptimizacióN Y Buenas PráCticas Para SqlTrucos, OptimizacióN Y Buenas PráCticas Para Sql
Trucos, OptimizacióN Y Buenas PráCticas Para SqlAntonio Soto
 
Mejores practicas sql
Mejores practicas sqlMejores practicas sql
Mejores practicas sqlnnakasone
 
Strategies for Distributed Data Storage
Strategies for Distributed Data StorageStrategies for Distributed Data Storage
Strategies for Distributed Data Storagekakugawa
 
Lo que siempre has querido saber para exprimir sql server
Lo que siempre has querido saber para exprimir sql serverLo que siempre has querido saber para exprimir sql server
Lo que siempre has querido saber para exprimir sql serverEnrique Catala Bañuls
 
Deep Dive into SharePoint Topologies and Server Architecture for SharePoint 2013
Deep Dive into SharePoint Topologies and Server Architecture for SharePoint 2013Deep Dive into SharePoint Topologies and Server Architecture for SharePoint 2013
Deep Dive into SharePoint Topologies and Server Architecture for SharePoint 2013K.Mohamed Faizal
 

Destaque (9)

Lecciones aprendidas SQL Server AlwaryOn
Lecciones aprendidas SQL Server AlwaryOnLecciones aprendidas SQL Server AlwaryOn
Lecciones aprendidas SQL Server AlwaryOn
 
Query store
Query storeQuery store
Query store
 
Guías y recomendaciones para instalar y configurar clusters de sql server
Guías y recomendaciones para instalar y configurar clusters de sql serverGuías y recomendaciones para instalar y configurar clusters de sql server
Guías y recomendaciones para instalar y configurar clusters de sql server
 
Novedades en el manejo de Grandes volúmenes de datos con SQL Server 2014
Novedades en el manejo de Grandes volúmenes de datos con SQL Server 2014Novedades en el manejo de Grandes volúmenes de datos con SQL Server 2014
Novedades en el manejo de Grandes volúmenes de datos con SQL Server 2014
 
Trucos, OptimizacióN Y Buenas PráCticas Para Sql
Trucos, OptimizacióN Y Buenas PráCticas Para SqlTrucos, OptimizacióN Y Buenas PráCticas Para Sql
Trucos, OptimizacióN Y Buenas PráCticas Para Sql
 
Mejores practicas sql
Mejores practicas sqlMejores practicas sql
Mejores practicas sql
 
Strategies for Distributed Data Storage
Strategies for Distributed Data StorageStrategies for Distributed Data Storage
Strategies for Distributed Data Storage
 
Lo que siempre has querido saber para exprimir sql server
Lo que siempre has querido saber para exprimir sql serverLo que siempre has querido saber para exprimir sql server
Lo que siempre has querido saber para exprimir sql server
 
Deep Dive into SharePoint Topologies and Server Architecture for SharePoint 2013
Deep Dive into SharePoint Topologies and Server Architecture for SharePoint 2013Deep Dive into SharePoint Topologies and Server Architecture for SharePoint 2013
Deep Dive into SharePoint Topologies and Server Architecture for SharePoint 2013
 

Semelhante a Minding SQL Server Memory

Investigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock HolmesInvestigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock HolmesRichard Douglas
 
Memory management in operating system | Paging | Virtual memory
Memory management in operating system | Paging | Virtual memoryMemory management in operating system | Paging | Virtual memory
Memory management in operating system | Paging | Virtual memoryShivam Mitra
 
MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017Ivan Zoratti
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyAntonios Chatzipavlis
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSPC Adriatics
 
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...Alluxio, Inc.
 
OSSEU18: NVDIMM and Virtualization - George Dunlap, Citrix
OSSEU18: NVDIMM and Virtualization  - George Dunlap, CitrixOSSEU18: NVDIMM and Virtualization  - George Dunlap, Citrix
OSSEU18: NVDIMM and Virtualization - George Dunlap, CitrixThe Linux Foundation
 
Caching your rails application
Caching your rails applicationCaching your rails application
Caching your rails applicationArrrrCamp
 
The Complete MariaDB Server tutorial
The Complete MariaDB Server tutorialThe Complete MariaDB Server tutorial
The Complete MariaDB Server tutorialColin Charles
 
SHARE Virtual Flash Memory VFM VSM_04-17-19.pdf
SHARE Virtual Flash Memory VFM VSM_04-17-19.pdfSHARE Virtual Flash Memory VFM VSM_04-17-19.pdf
SHARE Virtual Flash Memory VFM VSM_04-17-19.pdfssuser9f7ea5
 
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...VMworld
 
The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015Colin Charles
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]Speedment, Inc.
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]Malin Weiss
 
SQL 2014 In-Memory OLTP
SQL 2014 In-Memory  OLTPSQL 2014 In-Memory  OLTP
SQL 2014 In-Memory OLTPAmber Keyse
 
More Cache for Less Cash
More Cache for Less CashMore Cache for Less Cash
More Cache for Less CashMichael Collier
 
XPDDS18: NVDIMM Overview - George Dunlap, Citrix
XPDDS18: NVDIMM Overview - George Dunlap, Citrix XPDDS18: NVDIMM Overview - George Dunlap, Citrix
XPDDS18: NVDIMM Overview - George Dunlap, Citrix The Linux Foundation
 
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar Ahmed
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar AhmedPGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar Ahmed
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar AhmedEqunix Business Solutions
 

Semelhante a Minding SQL Server Memory (20)

Investigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock HolmesInvestigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock Holmes
 
Memory management in operating system | Paging | Virtual memory
Memory management in operating system | Paging | Virtual memoryMemory management in operating system | Paging | Virtual memory
Memory management in operating system | Paging | Virtual memory
 
MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017
 
SQL 2005 Memory Module
SQL 2005 Memory ModuleSQL 2005 Memory Module
SQL 2005 Memory Module
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctly
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
 
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
 
Drupal performance
Drupal performanceDrupal performance
Drupal performance
 
OSSEU18: NVDIMM and Virtualization - George Dunlap, Citrix
OSSEU18: NVDIMM and Virtualization  - George Dunlap, CitrixOSSEU18: NVDIMM and Virtualization  - George Dunlap, Citrix
OSSEU18: NVDIMM and Virtualization - George Dunlap, Citrix
 
Caching your rails application
Caching your rails applicationCaching your rails application
Caching your rails application
 
The Complete MariaDB Server tutorial
The Complete MariaDB Server tutorialThe Complete MariaDB Server tutorial
The Complete MariaDB Server tutorial
 
SHARE Virtual Flash Memory VFM VSM_04-17-19.pdf
SHARE Virtual Flash Memory VFM VSM_04-17-19.pdfSHARE Virtual Flash Memory VFM VSM_04-17-19.pdf
SHARE Virtual Flash Memory VFM VSM_04-17-19.pdf
 
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...
 
The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
 
SQL 2014 In-Memory OLTP
SQL 2014 In-Memory  OLTPSQL 2014 In-Memory  OLTP
SQL 2014 In-Memory OLTP
 
More Cache for Less Cash
More Cache for Less CashMore Cache for Less Cash
More Cache for Less Cash
 
XPDDS18: NVDIMM Overview - George Dunlap, Citrix
XPDDS18: NVDIMM Overview - George Dunlap, Citrix XPDDS18: NVDIMM Overview - George Dunlap, Citrix
XPDDS18: NVDIMM Overview - George Dunlap, Citrix
 
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar Ahmed
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar AhmedPGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar Ahmed
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar Ahmed
 

Mais de SQL Server Sri Lanka User Group (7)

Using Extended Events
Using Extended EventsUsing Extended Events
Using Extended Events
 
Breaking a Myth in 600 Seconds: Seek is Always Better than Scan
Breaking a Myth in 600 Seconds: Seek is Always Better than ScanBreaking a Myth in 600 Seconds: Seek is Always Better than Scan
Breaking a Myth in 600 Seconds: Seek is Always Better than Scan
 
Windowing Functions in SQL Server
Windowing Functions in SQL ServerWindowing Functions in SQL Server
Windowing Functions in SQL Server
 
Anything SQL: Lightning Talks
Anything SQL: Lightning TalksAnything SQL: Lightning Talks
Anything SQL: Lightning Talks
 
Whirlwind DBA Demos
Whirlwind DBA DemosWhirlwind DBA Demos
Whirlwind DBA Demos
 
Why OLAP? How OLAP.
Why OLAP? How OLAP.Why OLAP? How OLAP.
Why OLAP? How OLAP.
 
Using Resource Governor to Control Resource Utilization
Using Resource Governor to Control Resource UtilizationUsing Resource Governor to Control Resource Utilization
Using Resource Governor to Control Resource Utilization
 

Último

Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramMoniSankarHazra
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...amitlee9823
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...amitlee9823
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...amitlee9823
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 

Último (20)

Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 

Minding SQL Server Memory

  • 2. AGENDA • Introduction • 32 bit vs 64 bit • Terminology • Memory support in Windows • SQL Server Memory
  • 3. PHYSICAL MEMORY • RAM (system memory, main memory, primary storage) • DIMM’s • Measured in MB or GB • Faster access (5-12GB/sec) • Volatile • Expensive • Windows Server 2008 R2 Datacenter and Enterprise Editions can now support systems with 2TB of RAM
  • 4. VIRTUAL ADDRESS SPACE (VAS) • Mechanism to share the limited physical memory among the processes • Set of addresses that the processor uses to access anything on its bus • Some are reserved for • Video RAM • HW buffers, etc. • 32-bit w/o PAE, the address bus is 32 bits (4GB) • 32-bit Intel server processors with PAE, the address bus was 36 bits (64GB) • Limit address bus to 44 bits on 64-bit (16TB)
  • 5. VAS Source : Professional SQL Server® 2008 Internals and Troubleshooting
  • 6. • Address space is limited to 4GB • /3GB switch increases the user mode VAS to 3GB • /PAE Switch • Intel technology • Increases address bus to 36bits • Up to 64GB or 128GB of RAM
  • 7. • Theoretical limit is 18,446,744,073,709,551,616 Bytes • 16 exabytes = 16,777,216 petabytes (16 million PB) 17,179,869,184 terabytes (17 billion TB) 17,592,186,044,416 gigabytes (17 trillion GB) • Practical limitation – 44 bits address bus (16TB) • Enough address space for the foreseeable future • Logically it's split into an 8TB range for user mode and 8TB for kernel mode
  • 8. VIRTUAL MEMORY MANAGER (VMM) • Joins physical memory and virtual address space together Source : Professional SQL Server® 2008 Internals and Troubleshooting
  • 9. TERMINOLOGY • Processes • essentially container that hosts the execution of an executable image file • process has a virtual address space that holds the process’s private and shared data • Threads • a process includes one or more threads that actually execute the code in the process • PTE • OS mechanism of mapping VAS to physical memory page • Page file • a disk file that the computer uses to increase the amount of physical storage for virtual memory
  • 10. TERMINOLOGY • Reserved memory/MemToLeave • applications reservations to create a large block of VM. only in the startup process in 32- bit SQL Server • Current commit charge • amount of committed virtual memory for all the active processes. RAM size is the max limit • Page fault • writes the data from page file into memory • Soft page faults • occur when a new page of memory is required (VirtualAlloc) • Hard page faults • occurs when SQL Server tries to access a page of its memory that has been paged out to the page file
  • 11. TERMINOLOGY… • Private bytes • bytes allocated exclusively for a specific process • Committed memory / Working Set • the shared and private bytes allocated to a process backed by RAM. reflects the physical memory usage of a process • Paged pool • windows can write the data it stores to the paging file • Non-paged pool • the kernel and device drivers use non-paged pool to store data that might be accessed when the system can’t handle page faults
  • 12. SQL SERVER MEMORY • Three levels (bottom to top) • Memory nodes • Memory clerks, cache stores • Memory objects • Only memory clerks can access memory • Create new memory clerks if want to allocate more memory
  • 13. MEMORY NODES • DMVs • sys.dm_os_memory_nodes • More memory nodes if NUMA enabled • Each memory node has its own memory clerks and caches • Total usage is calculated using the sum of all the nodes
  • 14. MEMORY CLERKS, CACHES, AND THE BUFFER POOL • Clerks • DMV - sys.dm_os_memory_clerks • MEMORYCLERK_SQLGENERAL • MEMORYCLERK_SQLQUERYPLAN • Troubleshooting much easier • Cache • object store, cache store, user store • DMV - sys.dm_os_memory_cache_counters • Buffer pool • manage data cache • DMV - sys.dm_os_buffer_descriptors
  • 15. PLAN CACHE • Cache all the execution plans • DMV - sys.dm_exec_cached_plans • Look for the procedure cache option in DBCC MEMORYSTATUS
  • 16. PLAN CACHE IN A PROD SERVER • What is Adhoc? • Use of DBCC FREESYSTEMCACHE('SQL Plans')
  • 17. QUERY MEMORY/WORKSPACE MEMORY • Used to temporarily store results during hash and sort operations • Allocated out of the buffer pool • DMV – sys.dm_exec_query_memory_grants • Perfmon counters • Granted Workspace Memory (KB) • Maximum Workspace Memory (KB) • Memory Grants Pending • Memory Grants Outstanding • RESOURCE_SEMAPHORE wait type • Demo
  • 18. MIN AND MAX SERVER MEMORY • Control only buffer pool size • Min • min physical memory try to keep committed • when the SQL Server service starts, it does not acquire all the memory configured in Min • Max • when the SQL Server service starts, it does not acquire all the memory configured in Max • a "ceiling" for the buffer pool • Can be used “sp_configure” to set
  • 19. AWE ENABLED OPTION • In SQL Server 2008 R2 • SQL Server process needs to have the "Lock Pages in Memory" Advanced User Right in Windows • Only data pages can be stored in AWE mapped memory
  • 20. AWE ENABLED OPTION • Deprecated in SQL Server 2008 R2 • SQL Server 2012, this configuration option and the feature that uses this configuration option are removed from the product (32 bit and 64 bit) Source : http://support.microsoft.com/default.aspx?scid=kb;EN-US;2644592
  • 21. LPIM • AWE APIs to allocate and map physical memory to process address space • OS never paged out AWE API allocated memory • "Lock Pages In Memory“ right need to be granted • Simplified in SQL Server 2012 (32 bit and 64 bit) • Need to revisit the “max/min server memory” • Not be part of the working set • Overall system performance is a concern due to memory starvation
  • 22. LPIM RIGHT AND SQL SERVER Source : http://support.microsoft.com/kb/2659143
  • 23. IS LPIM ENABLED? • use sys.dm_os_memory_nodes, sys.dm_os_nodes dmvs • Memory Manager section of DBCC MEMORYSTATUS • Current SQL Server Error log Using locked pages in the memory manager
  • 24. WINDOWS MAX MEMORY? • Why 2TB maximum limitation on Windows? • Windows Server 2008 Datacenter support maximum • Not h/w limitation • Testing limitation •
  • 25. CHANGES IN SQL SERVER 2012 • memory allocation is controlled by the max server memory (MB) and min server memory (MB) configuration options. Source : http://support.microsoft.com/default.aspx?scid=kb;EN-US;2663912
  • 26. CHANGES IN SQL SERVER 2012 • Changes to "memory_to_reserve“ Source : http://support.microsoft.com/default.aspx?scid=kb;EN-US;2663912
  • 27. PERFMON COUNTERS • Process: Page Faults / sec • Memory/Pool Paged Bytes • Memory/Pool Nonpaged Bytes • MemoryFree System Page Table
  • 28. REFERENCES • http://support.microsoft.com/default.aspx?scid=kb;EN-US;2644592 • http://support.microsoft.com/kb/2659143 • http://blogs.msdn.com/b/slavao/archive/2005/04/29/413425.aspx • http://sqlblog.com/blogs/sqlos_team/archive/2012/06/20/sql-server-2012-memory-manager-kb-articles.aspx • http://msdn.microsoft.com/en-us/library/aa175282(v=sql.80).aspx • Book: Professional SQL Server® 2008 Internals and Troubleshooting • Whitepaper - "Advances in Memory Management in Windows"
  • 29. Q & A