Results (
Thai) 2:
[Copy]Copied!
You now know that caching allows a computer to access frequently used data
from a smaller but faster cache memory. Cache is found near the top of our memory
hierarchy. Another important concept inherent in the hierarchy is virtual
memory. The purpose of virtual memory is to use the hard disk as an extension of
RAM, thus increasing the available address space a process can use. Most personal
computers have a relatively small amount (typically less than 512MB) of
main memory. This is usually not enough memory to hold multiple applications
concurrently, such as a word processing application, an e-mail program, and a
graphics program, in addition to the operating system itself. Using virtual memory,
your computer addresses more main memory than it actually has, and it uses
the hard drive to hold the excess. This area on the hard drive is called a page file,
because it holds chunks of main memory on the hard drive. The easiest way to
think about virtual memory is to conceptualize it as an imaginary memory location
in which all addressing issues are handled by the operating system.
The most common way to implement virtual memory is by using paging, a
method in which main memory is divided into fixed-size blocks and programs are
divided into the same size blocks. Typically, chunks of the program are brought into
memory as needed. It is not necessary to store contiguous chunks of the program in
contiguous chunks of main memory. Because pieces of the program can be stored
out of order, program addresses, once generated by the CPU, must be translated to
main memory addresses. Remember, in caching, a main memory address had to be
transformed into a cache location. The same is true when using virtual memory;
every virtual address must be translated into a physical address. How is this done?
Before delving further into an explanation of virtual memory, let’s define some frequently
used terms for virtual memory implemented through paging:
• Virtual address—The logical or program address that the process uses. Whenever
the CPU generates an address, it is always in terms of virtual address space.
• Physical address—The real address in physical memory.
• Mapping—The mechanism by which virtual addresses are translated into
physical ones (very similar to cache mapping)
• Page frames—The equal-size chunks or blocks into which main memory
(physical memory) is divided.
• Pages—The chunks or blocks into which virtual memory (the logical address
space) is divided, each equal in size to a page frame. Virtual pages are stored
on disk until needed.
Being translated, please wait..
