Operating System Fundamentals
58 Virtual Memory Despite the fact that most modern computers have between 1 GB and 4
GB of RAM, it is possible to run out of memory. This can happen when you are running too many processes at the same time, or when a process requires more memory than is currently available (unused. One solution
to this problem is to use virtual memory. Virtual memory means that the operating systems memory manager will use a portion of another storage device to act as if it is extra RAM. Inmost cases, this virtual memory space will be on a permanent storage device such as a hard disk. However, some newer operating systems (such as Windows Vista and Windows 7) also allow you to use a removable media device like a USB flash drive as virtual memory (called
Windows Ready Boost). The memory manager will manage this resource so that it gives the illusion that your computer has more RAM than is actually installed.
How Virtual Memory Works Virtual memory works by breaking down large programs
into smaller units called pages. The memory manager will store these pages on an area of the storage device (hard disk) that has been allocated for use as virtual memory. This area is called a
Page File (or Paging File. All of the pages
that are currently loaded in main memory (RAM) will be listed in a
Page Table, which is maintained by the memory manager. If a process requests a page that is not currently loaded into RAM (in
the Page Table, then a
page fault will be generated. The memory manager will attempt to resolve the page fault by locating the requested page in virtual memory and then loading it into RAM (and listing it in the Page File. The memory manager will then try tore- execute the instruction that caused the fault.
Share with your friends: