View Single Post
  #2  
Old August 18th 03, 12:24 PM
philo
external usenet poster
 
Posts: n/a
Default

Hi,I am very confused about what virtual memory really is. I have
heard that since a lot of programs are very big compared to relatively
small RAM these days, people started to use the part of hard drive as
a virtual memory. But suppose that I have a memory which can store the
first 10 instructions and the data those 10 instructions needs. Does
the cpu first fetches all of those informations in RAM, and then once
the cpu is done with those instructions and data, it looks for the
next 10 instructions in the hard drive, and copy those instructions
into RAM to execute them? Or the cpu simply goes to the virtual
memory(hard drive)
in a very random way? I have got the feeling that accessing to a hard
drive takes much longer than retrieving the data from RAM, so it seems
more reasonable to fetch as many related instructions and data into
RAM first, instead of fetching a piece of instructions or data from a
hard drive randomly..
I am also confused with the term " offset". This term was used when
the idea that a virtual memory consists of "pages" was introduced. I
was told that pages consist of "virtual page frame number" and
"offset". I still don't understand what this offset does. It seems
that in order to relate the address in virtual memory to the address
in physical memeory,a process page table needs only a virtual page
frame number.



not everything you;ve heard is quite correct...
many years ago RAM was quite expensive so most computers had very little...
but today RAM is a lot less expensive so most people have a lot of it in
their
machines

as an application uses RAM...if there is not enough avail...
then the virtual memory (swapfile) is used..
and yes, you are correct, using the harddrive for "memory"
is a lot slower than using actual RAM.

back in the days when machines might have only had 8 megs of RAM...
virtual memory was quite important...
but with machines having 500megs to 1 gig of RAM...
it's not too likely that virtual memory is terribly important...