Virtual Memory Flashcards
What is the goal of Virtual Memory?
to allow running processes with
memory requirements larger than available RAM to
run in the computer
How does Virtual Memory work today? (very high level)
gives each
process its own address space.
How does Virtual Memory store memory?
VM only keeps in RAM the memory that is
currently in use
The remaining memory is kept in disk in a
special file called “swap space”
This also specifically works through pages
Who created the idea of Virtual Memory?
Peter Denning a former head of the CS Department at Purdue
How does VM speed up OS tasks?
● Loading a program. The VM will load pages of the program as
they are needed, instead of loading the program all at once.
● During fork the child gets a copy of the memory of the
parent. However, parent and child will use the same memory as
long as it is not modified, making the fork call faster. This is called
“copy-on-write”.
● Shared Libraries across processes.
● Shared memory
What is VM Process Swapping?
The entire memory of the process is swapped in and out
of memory
What is VM Segment Swapping?
Entire parts of the program (process) are swapped in
and out of memory (libraries, text, data, bss, etc.
Problems of process swapping and segment swapping
is that the granularity was too big and some pieces still
in use could be swapped out together with the pieces
that were not in use
What is Paging in VM?
Process of dividing memory into fixed size, used in modern day OS
What is the size of a X86 + ARM page vs. a Sparc
Ultra Architecture/Alpha page?
x86+ARM usually 4KB, Spark usually 8Kb
What is a Backing Store?
A file in disk that “backs” the page (maybe research more)
What is the Swap Space?
A designated area in disk that is used by the VM system to store transient data. Generally data that will go away when the process exits goes to swap space.
What are specific examples of sections in memory stored in swap space typically?
Stack, Heap, BSS, modified data
What does the Memory Management Unit do? (MMU)
Translates Virtual Memory Addresses (vmaddr) to physical
memory addresses (phaddr) using a page table.
What are the two different types of addresses?
Virtual Memory Addresses: the address that the
CPU is using. Addresses used by programs are of
this type.
Physical Memory Addresses: The addresses of
RAM pages. This is the hardware address.
Does the cpu interact with virtual or physical addresses?
virtual