Most computers have two forms of memory, virtual memory and physical memory. Virtual memory, as the name implies, is merely a construct that allows a program to operate as though all the information needed to run it is stored in the same place. Each piece of information stored in virtual memory corresponds to a physical memory address. A page table is the data structure the computer’s operating system uses to keep track of the connections between virtual memory and physical memory. The process of correlating virtual memory with physical memory is called mapping.
The concept of how the page table organizes the two kinds of memory is best understood using a familiar example. When a computer user creates a playlist in a media player program, he or she may take songs from several different files on the computer. The physical files are not moved, but the program knows where to go to access each song in turn.
The playlist is like the virtual memory. It is a contiguous block of information easily accessed by the program. The individual files with the individual songs in them are like physical memory. They are stored in many different places throughout the computer. The physical memory is stored in a page table.
A piece of hardware in the computer receives requests from virtual memory and then accesses the page table to find the physical memory location of the data. This hardware is called either the memory management unit (MMU) or the dynamic address translation (DAT) unit. In order to make data access happen as quickly as possible, the MMU stores a finite number of often used maps in a table called the translation lookaside buffer. Operating like the favorites tab in a web browser, the translation lookaside buffer allows the computer to quickly jump to an often used memory location.
If the address in question is not one the computer asks for often, the MMU will access the page table directly. It scans through the table until it finds the address in question. Then it returns the address to the translation lookaside buffer from which the program is able to access the information.
Sometimes the computer can’t find the address on the page table. This can happen if no map exists between the virtual memory and the physical memory. In this case, the operating system will send a message to the program telling it to shut down. Look up can also fail if the physical file has been moved, for instance if it has been put on a backup disk and removed from the system.