Virtual Memory vs. Physical Memory

Windows provides all processes a 4GB virtual memory sandbox in which to play. By “virtual” I mean that the memory isn't memory in the traditional sense. It is merely a range of addresses with no physical storage implicitly associated with it. As a process makes memory allocations, these addresses are used and physical storage is associated with them. However, this physical storage is not necessarily (and not usually) physical memory. It is usually disk drive space. Specifically, it's space in the system paging file(s). That's how multiple applications can run on a system with 128MB of memory, each with a virtual address space of 4GB—it's not real memory, but it seems like it to the application. Windows transparently handles copying data to and from the paging file so that the app can allocate more memory than physically exists in the machine and so that multiple apps can have equal access to the machine's physical RAM.

This 4GB address space is divided into two partitions: the user mode partition and the kernel mode partition. By default, each of these is sized at 2GB, though you can change this through BOOT.INI switches on the Windows NT family of the OS. (Windows NT, Windows 2000, Windows XP, and Windows Server 2003 are members of the Windows NT family; Windows 9x and Windows ME are not.)

Although each process receives its own virtual memory address space, OS code and device driver code share a single private address space. Each virtual memory page is associated with a particular processor mode. In order for the page to be accessed, the processor must be in the required mode. This means that user applications cannot access kernel mode virtual memory directly; the system must switch into kernel mode in order for kernel mode memory to be accessible.

We'll talk more about virtual memory and how Windows manages it in Chapter 4, Memory Fundamentals. For now, just understand that virtual memory does not necessarily correlate to physical memory. It is a service provided by Windows that allows applications (and Windows itself) to allocate and use more primary storage (memory) than physically exists in a machine without having to handle paging data to and from secondary storage (disk drives).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.246.218