Virtual Memory Flashcards
What are the drawbacks of VM?
Performance Overhead. We have to go back and forth from the memory to the hard disk. It is much slower than it is to run from memory to memory.
What is virtual memory?
Virtual memory is a memory management technique used by operating systems to simulate or extend the available physical memory (RAM) by utilizing secondary storage, such as a hard drive or SSD, as an extension of RAM.
What is paging?
Paging is a memory management technique that divides physical memory into fixed-size blocks, called pages. When a process needs to access memory, the operating system translates the virtual address to a physical address by using a page table.
What is virtual memory paging?
Virtual memory paging is a memory management technique that allows a process to access more memory than is physically available. This is done by swapping pages between physical memory and a secondary storage device, such as a hard disk drive or solid-state drive.
What is the principle of locality and why does it happen?
States that computer programs tend to access the same set of memory locations repetitively over a short period of time.
This is because programs are typically structured in a way that loops over data or repeatedly calls subroutines.
What is Temporal locality?
This refers to the tendency to reuse recently accessed data or instructions.
What is spatial locality?
This refers to the tendency to access data or instructions that are located close to each other in memory.
How is the principle of locality used in virtual memory?
The principle of locality is used in virtual memory to improve performance by reducing the number of page faults.
Under what circumstances to page faults occur?
What is a page fault?
A page fault occurs when the processor tries to access a page of memory that is not currently in physical memory. Can occur in demand and pre paging.
What is demand paging?
A memory management technique that loads pages of memory into physical memory only when they are needed.
What is pre paging?
Loads all of the pages of a process into physical memory before the process starts executing.
What is Belady’s Anomaly?
Phenomenon in virtual memory paging systems where increasing the number of page frames can result in an increase in the number of page faults.