Usually the lower 2 gigabytes are used for user space, and the upper 2 gigabytes are used for system space. In 32-bit Windows, the total available virtual address space is 2^32 bytes (4 gigabytes). The virtual address space for a user-mode process is called user space. For more information about processor modes, see User mode and kernel mode.Įach user-mode process has its own private virtual address space, but all code that runs in kernel mode shares a single virtual address space called system space. Core operating system components and many drivers run in the more privileged kernel mode. Processes like Notepad.exe and MyApp.exe run in user mode. Also notice that both processes use a page of virtual memory beginning at 0x7F7'93950000, but those virtual pages are mapped to different pages of physical memory. But those three contiguous pages of virtual addresses are mapped to noncontiguous pages in physical memory. Notice that the Notepad process uses three contiguous pages of virtual addresses, starting at 0x7F7'93950000. Each shaded block represents one page (4 kilobytes in size) of virtual or physical memory. Each process has its own virtual address space that goes from 0x000'0000000 through 0x7FF'FFFFFFFF. The diagram shows the virtual address spaces for two 64-bit processes: Notepad.exe and MyApp.exe. This diagram illustrates some of the key features of virtual address spaces. For more info, see Memory and Address Space Limits. Each user-mode process has its own private virtual address space.įor a 32-bit process, the virtual address space is usually the 2-gigabyte range 0x00000000 through 0x7FFFFFFF.įor a 64-bit process on 64-bit Windows, the virtual address space is the 128-terabyte range 0x000'00000000 through 0x7FFF'FFFFFFFF.Ī range of virtual addresses is sometimes called a range of virtual memory. The range of virtual addresses that is available to a process is called the virtual address space for the process. The code in one process cannot alter the physical memory that is being used by another process or the operating system. The virtual addresses used by different processes are isolated from each other. Pages of data or code are moved between physical memory and the disk as needed. As the supply of physical memory becomes small, the memory manager saves pages of physical memory (typically 4 kilobytes in size) to a disk file. As part of the read or write operation, the processor translates the virtual address to a physical address.Īccessing memory through a virtual address has these advantages:Ī program can use a contiguous range of virtual addresses to access a large memory buffer that is not contiguous in physical memory.Ī program can use a range of virtual addresses to access a memory buffer that is larger than the available physical memory. When a processor reads or writes to a memory location, it uses a virtual address.
0 Comments
Leave a Reply. |