30.06.2013 Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

System-wide memory use<br />

303<br />

Chapter 7: OS and Hardware Interaction<br />

There are a few ways to get a picture of the memory use in <strong>SQL</strong> <strong>Server</strong> using the<br />

DMVs but, new to <strong>SQL</strong> <strong>Server</strong> 2008, there is an excellent DMV called sys.dm_os_sys_<br />

memory that provides a summarization of the memory condition of the system. It shows<br />

the current levels of memory in the system, the cache, and so on. Amongst the columns<br />

this view returns are:<br />

• total_physical_memory_kb – the total amount of non-virtual memory available<br />

to the OS in kilobytes<br />

• available_physical_memory_kb – the amount of non-virtual memory currently<br />

available to the OS<br />

• total_page_file_kb – the current size of the OS's virtual memory/page file<br />

• available_page_file_kb – the amount of virtual memory currently available to<br />

the OS<br />

• system_memory_state_desc – calculated value based on two other columns<br />

(system_high_memory_signal_state and system_low_memory_signal_<br />

state) that indicates if available memory is high, low, steady, or transitioning from<br />

one state to another.<br />

• The final column in this list, system_memory_state_desc, requires a little more<br />

explanation. When you start the server, this value will likely be "Available physical<br />

memory is high," while a value of "Available physical memory is low" is an indicator of<br />

external memory pressure, since it means that the OS has little available memory and so<br />

may require <strong>SQL</strong> <strong>Server</strong> to reduce its memory usage. This will result in <strong>SQL</strong> <strong>Server</strong><br />

reducing the size of all of its memory caches, and means that plans will get flushed from<br />

the plan cache, and so on.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!