how does virtual memory work?

Answer Posted / ron

Today’s processors - the 286, 386, 486 and the Pentium -
can use virtual memory in addition to real memory. Virtual
memory is a service provided by a protected mode operating
system such as the Windows and the Windows 95 working in
conjunction with built-in features of the processor to use
external storage, to simulate large amounts of real memory.
Virtual memory is an operation that involves some carefully
timed cooperation among the processor, a virtual memory
support program and the disk drive.
When a program is being set up to run in the computer, the
operating system creates a virtual memory space, which is a
model of the amount of memory and the memory addresses the
program has at its disposal. Using a feature that is an
integral part of the processor, the operating system’s
virtual memory support program tells the processor to make
the real memory of the computer assigned to the running
program appear to be at some other address. This other
address is the virtual address that the program will use. A
memory mapping feature in the processor makes the real
memory appear to have a working memory address other than
its true address. This makes some real memory addresses
appear to be, and work as, some other virtual addresses.The
more important part of the virtual memory support program
is to handle a situation when a program tries to use more
virtual memory than there is real memory. A program starts
out with some of its usually large virtual memory space
mapped into a part of the computer’s comparatively smaller
real memory. As long as the program is working with only
that part of the its virtual memory, all goes fine. The
program actually is using different locations in memory
than it thinks it is, but that does not matter. When the
program refers to that part of the large virtual memory
that has not been assigned to a part of the real memory,
the processor discovers that the program is trying to use
an address that does not currently exists; and the
processor generates what is called a page fault. When there
is a page fault, indicating that a program is trying to use
a virtual address that is not actively mapped into real
memory, a special virtual memory support program swings
into action. It temporarily places the program on hold
while it deals with the crisis. The support program chooses
some part of the memory currently in real memory and saves
its contents temporarily on the disk; this process is
called swapping out. That free-up part of the real memory
is recycled to act as the needed part of the virtual
memory. When the swapped-out part of the memory is needed
again, it is copied back in from the disk. Thus the disk
acts as the warehouse for storing the parts of virtual
memory that are not in current use.
Depending on how things go, the virtual memory operation
can run very smoothly or may involve so much swapping in
and out of memory that a lot of time is wasted waiting for
the swaps to take place. The latter is called thrashing.

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what kind of operating(s)systems would be needed (and explain why) in an environment where there exist various cluster of networks which are all interconnected in different geographical areas with strong emphasis on online applicating process.

1723


What are go channels?

644


How do you remove a virus from your computer?

601


The flushing policy is described in the subsection on process migration strategies: a) From the perspective of the source, which other strategy does flushing resembles? b) From the perspective of the target, which other strategy does flushing resemble?

1887


How do you start up a computer?

610






What is a file in os?

695


Who started gnu?

791


Which is better curl or wget?

689


What is microsoft spreadsheet compare?

631


Do cores matter for gaming?

631


Why does kernel panic occur?

625


wha is very first process created by kernel

705


What is the name of first operating system?

590


What happens if you turn off computer during update?

556


What is operating system and its examples?

620