Virtual Memory Flashcards
3 problems with running more than one program without virtual memory ?
Have to decide where you are going to put each program in memory
Each program in memory needs to be careful not to overwrite the data and the program used by the other the other task that’s running
Needs to be relative addressing
Example of relative addressing
Can only say “do something 10 bytes forward from here, or 5 bytes back from here”
You cannot use an absolute address like 4095 because that could belong to something else
Memory fragmentation
Gaps appearing in memory due to opening and closing different programs and them trying to fit into whatever space is left
What is the MMU ?
The Memory Management Unit
What does the MMU do ?
It Maps from the virtual address that the app thinks it is running in to an actual physical address in memory
What does a program think is happening when you have virtual memory ?
That it is the only program running
What problem does Virtual Memory solve ?
Memory Fragmentation
What is the name for the blocks that main memory is divided into ?
Pages
What size are pages typically ?
4k
Where are virtual tables held ?
In RAM
Where does a translated address go to ?
Cache
What does TLB stand for ?
Translation Lookaside Buffer.
What is it called when an address cannot be found ?
A page fault.
Why might you get a page fault.
The app is trying to access and address that is not allowed to. Its not been allocated that memory.