14.04.2013 Views

SQL SERVER 2008

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

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

Virtual Memory Manager<br />

Physical and Virtual Memory ❘ 57<br />

NOTE x64 is the predominant 64-bit architecture in use today, but Intel<br />

developed an alternative architecture known as IA-64 that is implemented in its<br />

Itanium processors. It was designed as a high-end alternative to mainframes, but<br />

the platform didn’t have very many production implementations of <strong>SQL</strong> Server<br />

and has subsequently been dropped from <strong>SQL</strong> Server 2012. Windows has also<br />

dropped support for IA-64 with the release of Windows Server 2012, which runs<br />

only on x64.<br />

NOTE The virtual address space for a 32-bit system is only 4GB, which when<br />

broken down into 2GB for kernel mode and 2GB for user mode, doesn’t provide<br />

much space at all. It is this memory addressing limitation that is the key driver<br />

for the adoption of 64-bit.<br />

Chapter 2 of the previous edition of this book, Professional <strong>SQL</strong> Server <strong>2008</strong><br />

Internals and Troubleshooting, provides extensive coverage of 32-bit Windows<br />

and <strong>SQL</strong> Server environments, including all of the tuning options.<br />

The Virtual Memory Manager (VMM) is the part of Windows that links together physical<br />

memory and virtual address space. When a process needs to read from or write something<br />

into memory, it references an address in its VAS; and the VMM will map it to an address in RAM.<br />

It isn’t guaranteed, however, to still be mapped to an address in RAM the next time you access it<br />

because the VMM may determine that it needs to move your data to the page fi le temporarily to<br />

allow another process to use the physical memory address. As part of this process, the<br />

VMM updates the VAS address and makes it invalid (it doesn’t point to an address in RAM<br />

anymore). The next time you access this address, it has to be loaded from the page fi le on disk,<br />

so the request is slower — this is known as a page fault and it happens automatically without you<br />

knowing.<br />

The portion of a process’s VAS that currently maps to physical RAM is known as the working set.<br />

If a process requests data that isn’t currently in the working set, then it needs to be reloaded back<br />

into memory before use. This is called a hard page fault (a soft page fault is when the page is still<br />

on the standby list in physical memory); and to fi x it, the VMM retrieves the data from the page<br />

fi le, fi nds a free page of memory, either from its list of free pages or from another process, writes<br />

the data from the page fi le into memory, and then maps the new page back into the process’s virtual<br />

address space.

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

Saved successfully!

Ooh no, something went wrong!