Virtual Memory Manager

The memory architecture for Windows NT is a demand-paged virtual memory system. It is based on a flat, linear address space accessed via 32-bit addresses.

Virtual memory refers to the fact that the operating system can actually allocate more memory than the computer physically contains. Each process is allocated a unique virtual address space, which is a set of addresses available for the process's threads to use. This virtual address space is divided into equal blocks, or pages. Every process is allocated its own virtual address space, which appears to be 4 gigabytes (GB) in size — 2 GB reserved for program storage and 2 GB reserved for system storage. Windows NT can see up to 4 GB of physical memory, if the computer hardware can provide it. Few operating systems can see this much memory. MS OS/2 version 1.3, for example, can only see 16 MB of physical memory.

Demand paging refers to a method by which data is moved in pages from physical memory to a temporary paging file on disk. As the data is needed by a process, it is paged back into physical memory.

Figure 1.3 Conceptual View of Virtual Memory

The Virtual Memory Manager maps virtual addresses in the process's address space to physical pages in the computer's memory. In doing so, it hides the physical organization of memory from the process's threads. This ensures that the thread can access its process's memory as needed, but not the memory of other processes. Therefore, as illustrated by Figure 1.4, a thread's view of its process's virtual memory is much simpler than the real arrangement of pages in physical memory.

Figure 1.4 Protecting Processes' Memory

Because each process has a separate address space, a thread in one process cannot view or modify the memory of another process without authorization.