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.

Chapter 7: OS and Hardware Interaction<br />

When memory utilization is just right, the value will be "Physical memory state is steady."<br />

For short periods, you may very occasionally see a third value of "Physical memory state<br />

is transitioning," indicating that the memory state is changing from high to low, or<br />

vice versa.<br />

Using these five columns, as shown in Listing 7.22, we can get an overview of how much<br />

RAM is available to the operating system in total, and how much of it is currently not in<br />

use. The first and second values correspond to the Task Manager Physical Memory (MB)<br />

values for total and available memory.<br />

SELECT total_physical_memory_kb / 1024 AS total_physical_memory_mb ,<br />

available_physical_memory_kb / 1024 AS available_physical_memory_mb ,<br />

total_page_file_kb / 1024 AS total_page_file_mb ,<br />

available_page_file_kb / 1024 AS available_page_file_mb ,<br />

system_memory_state_desc<br />

FROM sys.dm_os_sys_memory<br />

Listing 7.22: System memory usage.<br />

The following results were taken from my writing laptop <strong>with</strong> just under 2 GB of RAM<br />

(some allocated to video RAM).<br />

total_physical_memory_mb available_physical_memory_mb total_page_file_kb<br />

------------------------ ---------------------------- --------------------<br />

1912 912 3825<br />

available_page_file_kb system_memory_state_desc<br />

---------------------- ---------------------------------<br />

2265 Available physical memory is high<br />

304

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

Saved successfully!

Ooh no, something went wrong!