Virtual Memory Part 1 Flashcards
Instructions must be in ________ memory to be executed
physical
What is program size limited to?
Physical memory size
Physical memory cannot support a lot of processes. Thus ________ suffers
multiprogramming
We desire to allow some portions of the address space to be ___-_______ _________
non-memory resident
Non-memory resident means not in ______ memory
physical
What is demand paging?
Loading program code/data pages into memory on demand
An item that could be a candidate for demand paging are _____ _______
shared libraries
Swapping is when the OS stashes ______ pages away to the _____ ______ backed by stable storage
memory, swap space
Virtual memory gives the application the illusion of an ________ amount of memory
infinite
_______ memory supports more processes concurrently
virtual
What are 2 related approaches to virtual memory?
Swapping and demand paging
In demand paging, a page is brought into memory only when ______
needed
What are 3 benefits of demand paging?
- Less I/O need
- Faster response (We only load needed pages)
- More processes admitted to the system
In demand paging, a process generates ______ (_____) addresses which are mapped to physical addresses using a ____ ____
logical, virtual, page table
In demand paging, if a requested ____ is not in memory, the _____ brings it from the hard disk
page, kernel
What is the swap space?
Storage space reserved for moving pages back and forth between storage and memory
With swap spacing, physical memory is represented in ______ and swap space is represented in ______
pages, blocks
In swap spacing, ____ size equals ____ size
page, block
In traditional swap spacing, _______ processes are swapped out (meaning all of its _____)
entire, pages
In modern implementation of swap spacing, only _____ of processes are swapped out
portions
How do we know if a page is in memory?
Each page table entry has a valid/present bit
A valid/present bit of 1 means the page is _________
in-memory
A valid/present bit of 0 means the page is _________
not-in-memory
During an address translation, if the valid bit equals 0, what to outcomes are there?
- Illegal reference (outside address space)
- Legal reference but not in memory
If there was an illegal reference during address translation, the OS must ____ the process
abort
A page fault is when the OS sets up a ____ page table entry
valid
What are the 6 steps in handling a page fault?
1. OS figures out: •Invalid reference ➔abort process •Just not in memory ➔bring page in 2. Locate page on disk 3. Find a free page frame 4. Swap page from disk to frame (I/O operation) 5. Reset page table, set valid bit to 1 6. Restart the instruction that caused page fault
Virtual memory allows faster/efficient process creation using ________________
copy-on-write (COW)
What does copy-on-write allow?
COW allows both parent and child processes to initially share the same pages in memory (during fork())
During COW, if either _______ or _____ process modifies a shared page, the page is ______-
parent, child, copied
A Major Page fault means the page needs to be brought from ____
disk
A major Page fault is __________ and includes ___
expensive, I/O
A Minor Page fault not need to bring a page from ______
disk
A Minor Page fault is typically very _______ and just _______ the page table
fast, updates
Shared pages already in memory that are ____ _________ with the process address space is an example of a _____ page fault
not linked, minor
Malloc-ing where the ______ may not actually allocate physical memory until it is ________ is an example of a ______ page fault. This can become a ________
kernel, accessed, minor, bottleneck
What does the command “ps -eomin_flt,maj_flt,pid,cmd” do?
Prints minor and major page faults for all (-e) processes running in the system with the format (-o) specified
Which linux command reports information about processes, memory paging, IO, traps, etc?
vmstat
Which linux command displays page size?
getconf PAGESIZE
What does the command “sync; /bin/echo 3 > /proc/sys/vm/drop_caches;” do?
Clears OS caches, but it needs sudo or root privileges