Databases Reference
In-Depth Information
Virtual Memory
If all the processes running on a computer could only use addresses in physical RAM, the system
would very quickly experience a bottleneck. All the processes would have to share the same range
of addresses, which are limited by the amount of RAM installed in the computer. Because physical
RAM is very fast to access and cannot be increased indei nitely (as just discussed in the previous
section), it's a resource that needs to be used efi ciently.
Windows (and many other mainstream, modern operating systems) assigns a virtual address space
(VAS) to each process. This provides a layer of abstraction between an application and physical
memory so that the operating system can choose the most efi cient way to use physical memory
across all the processes. For example, two different processes can both use the memory address
0xFFF because it's a virtual address and each process has its own VAS with the same
address range.
Whether that address maps to physical memory or not is determined by the operating system or,
more specii cally (for Windows at least), the Virtual Memory Manager, which is covered in the next
section.
The size of the virtual address space is determined largely by the CPU architecture. A 64-bit CPU
running 64-bit software (also known as the x64 platform ) is so named because it is based on an
architecture that can manipulate values that are up to 64 bits in length. This means that a 64-bit
memory pointer could potentially store a value between 0 and 18,446,744,073,709,551,616 to
reference a memory address.
This number is so large that in memory/storage terminology it equates to 16 exabytes (EBs). You
don't come across that term very often, so to grasp the scale, here is what 16 exabytes equals when
converted to more commonly used measurements:
16,384 petabytes (PB)
16,777,216 terabytes (TB)
0
100000000000
17,179,869,184 gigabytes (GB)
17 billion GB of RAM, anyone?
8TB
Kernel Mode
As you can see, the theoretical memory limits of a 64-bit architecture
go way beyond anything that could be used today or even in the near
future, so processor manufacturers implemented a 44-bit address bus
instead. This provides a virtual address space on 64-bit systems of
16TB.
0
80000000000
07FFFFFFFFFF
This was regarded as being more than enough address space for the
foreseeable future and logically it is split into two ranges of 8TB:
one for the process and one reserved for system use. These two ranges
are commonly referred to as user mode and kernel mode address
space and are illustrated in Figure 3-1. Each application process
(i.e., SQL Server) can access up to 8TB of VAS, and therefore up to
8TB of RAM (depending on operating system support — remember
Windows Server 2012 supports 4TB of RAM, so we're halfway there).
8TB
User Mode
01
FIGURE 3-1
 
 
Search WWH ::




Custom Search