Information Technology Reference
In-Depth Information
As this figure suggests, virtual memory is much larger than main
memory, and main memory is again much larger than cache. In the
figure, virtual memory is divided into five pages, which are the same
size as the large blocks in main memory. This main memory in the
figure is large enough for just two pages, and currently the pages
with light shading and with dots are loaded into main memory.
(Think of any of the shaded colors as part of the shaded page, and
any of the dotted areas as being part of the dotted page.)
In considering cache, pieces of memory are called lines (rather than
pages). The small shaded or dotted blocks or lines within main mem
ory are the same size as the pieces within cache, and the cache in the fig
ure is large enough to hold three lines. Currently, two lines of the lightly
shaded page and one line of the dotted page are loaded into cache.
When do data move from one type of memory to
another?
With various parts of a computer application involving files, vir
tual memory, main memory (RAM or ROM), cache, and CPU reg
isters, this question is natural! It can be hard to figure out just what
happens when an application runs. To understand this better, let's
follow the basic flow of information for an application, such as edit
ing an existing document with a word processor.
To begin, we click on a document, or we type the names of the
program and document in a window. This tells the computer that
processing is to begin. Some main steps follow:
1. The wordprocessing application is copied (probably from
CD or disk) to the disk area for virtual memory. A working
copy of the entire application now resides in virtual memory,
and the computer tries to start the program.
2. While running, the program will require the computer to fol
low some instructions from the program—perhaps to open an
editing environment on the screen with appropriate buttons
and windows. The computer realizes these instructions are
not yet in main memory, so the first section of the program is
copied from virtual memory into main memory.
3. As an individual instruction is needed by the CPU for process
ing, a copy of the instruction is placed in cache memory.
 
Search WWH ::




Custom Search