Question 1
EasyWhat does virtual memory allow?
- A.
Running without an operating system
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Operating Systems
What does virtual memory allow?
Running without an operating system
Making the CPU faster
Running programs larger than physical memory
Storing files without a disk
Answer: C
Only the parts of a program in use need to be in RAM; the rest stays on disk until needed.
What is a page fault?
An access to a page that is not currently in physical memory
An error in the page table's design
A page with a bug in it
A disk with bad sectors
Answer: A
The hardware traps to the OS, which loads the page from disk and restarts the instruction.
What is demand paging?
Writing every page to disk at exit
Loading the whole program at start-up
Asking the user which page to load
Loading a page into memory only when it is first accessed
Answer: D
Pages are brought in lazily, which saves memory and start-up time.
What is thrashing?
The system spends more time paging than executing processes
A disk being formatted
A fast CPU
A process with many threads
Answer: A
When processes don't have enough frames for their working sets, page faults pile up and CPU utilisation collapses.
What does the dirty (modified) bit of a page indicate?
The page belongs to the OS
The page was changed and must be written to disk before it is replaced
The page is corrupted
The page is read-only
Answer: B
A clean page can simply be discarded; a dirty page must be saved first.
Which page does FIFO page replacement remove?
A random page
The page that won't be used for the longest time
The page used least recently
The page that has been in memory the longest
Answer: D
FIFO evicts the oldest loaded page, regardless of how often it is used.
Which page does the optimal (OPT) algorithm replace?
The smallest page
The page that will not be used for the longest time in the future
The oldest page
The most recently used page
Answer: B
OPT has the fewest faults possible but needs knowledge of future references, so it is used as a benchmark.
In a virtual-memory system, what is swap space used for?
Storing user passwords
Keeping the CPU cool
Holding pages that are not currently in RAM
Holding the BIOS
Answer: C
Pages evicted from memory are kept in swap space on disk until needed again.
What happens on a page fault when there is no free frame?
The process is always killed
A page-replacement algorithm chooses a page to evict
The page is ignored
The disk is formatted
Answer: B
A victim page is removed (written back if it is dirty) to make room for the needed page.
Which page does the LRU algorithm replace?
The page used most recently
The page loaded first
A random page
The page that has not been used for the longest time
Answer: D
LRU (least recently used) assumes pages unused for a long time are least likely to be needed soon.