In older operating systems, physical storage was considered to be the amount of RAM that you had in your machine. In other words, if you had 16 MB of RAM in your machine, you could load and run applications that used up to 16 MB of RAM. Today's operating systems have the ability to make disk space look like memory. The file on the disk is typically called a paging file, and it contains the virtual memory that is available to all processes.

Of course, for virtual memory to work, a great deal of assistance is required from the CPU itself. When a thread attempts to access a byte of storage, the CPU must know whether that byte is in RAM or on the disk.
From an application's perspective, a paging file transparently increases the amount of RAM (or storage) that the application can use.  If you have 1 GB of RAM in your machine and also have a 1-GB paging file on your hard disk, the applications you're running believe that your machine has a grand total of 2 GB of RAM.
Of course, you don't actually have 2 GB of RAM. Instead, the operating system, in coordination with the CPU, saves portions of RAM to the paging file and loads portions of the paging file back into RAM as the running applications need them. Because a paging file increases the apparent amount of RAM available for applications, the use of a paging file is optional.  If you don't have a paging file, the system just thinks that there is less RAM available for applications to use. However, users are strongly encouraged to use paging files so that they can run more applications and those applications can work on larger data sets. It is best to think of physical storage as data stored in a paging file on a disk drive (usually a hard disk drive).  So when an application commits physical storage to a region of address space by calling the VirtualAlloc function, space is actually allocated from a file on the hard disk. The size of the system's paging file is the most important factor in determining how much physical storage is available to applications; the amount of RAM you have has very little effect.
Now when a thread in your process attempts to access a block of data in the process' address space (outside of a memory-mapped file as shown in Chapter 17, "Memory-Mapped Files"),  one of two things can happen, as shown in the simplified flowchart in Figure 13-2. (Read Microsoft Windows Internals by Mark Russinovich and David Solomon from Microsoft Press for more details.)
 
















本文转自cnn23711151CTO博客,原文链接: http://blog.51cto.com/cnn237111/533027 ,如需转载请自行联系原作者