Virtual memory study guide
"Software is like a gas. It expands to fill all available space."
The size of programs seems to be increasing faster than the size of our memory.
Co-founder of Sun Microsystems
Worked on the UNIX system
Sun Microsystems was founded right after the legal monopoly (held by AT&T) was renounced.
Page memory and page frame are each 4 kB.
On a 32-bit machine the address is divided into two parts, page offset and page number
32-bit address is divided into 12 bit page-offset an a 20 bit page number (virtual address).
The page table needs to be able to tell us whether or not the page is already loaded into physical memory (present bit).
The dirty bit tells us whether or not the page has been changed at all.
This will tell the computer whether or not it needs to copy the data before changing it.
Some pages may have different levels of protection than others (read, write, read/write).
We have 220 pages.
Each page table is 4MB.
These page tables came into use when our computers only had 1MB of memory.
The page table is loaded into memory in parts, loading the most frequently used parts.
In a 64 bit system 12 bits are still used for the page offset, so 52 bits are used for the page number.
252 pages. 4.5 * 1015
TLB (Translation Lookaside Buffer)
If the page table is too big for main memory we may have to load only parts at a time. The TLB is a sort of cache for the page table.
The entries in the TLB are not consecutive.
There are key-value pairs that allow us to look up what we need in one operation.
Multi-level page table
One table has an address to a second table that has more information.
This is another way of saving space by not loading all of the information into memory at once.
Inverted Page Tables
You store only as many pages as you can fit in memory.
It is called inverted because we have an entry for the page frames in stead of the page number.
Page replacement algorithms
These choose which pages are taken out first.
LRU - Chooses the page that was used the longest time ago.
A count is required on every page.
FIFO - First in first out
Optimal page replacement (clairvoyant replacement) -
Not frequently used - Boolean system that keeps track of whether the page was recently used or not.
Least frequently used -
Memory Management Unit
A memory management unit (MMU) is a computer hardware component that handles all memory and caching operations associated with the processor. In other words, the MMU is responsible for all aspects of memory management.