1. Home
  2. Explore
  3. Computer Science
  4. Virtual Memory Management

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Virtual Memory Management

  • 27Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Virtual Memory Concepts
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is virtual memory?

Tap to flipClick to flipspace

A memory management technique that creates a logical memory space distinct from physical memory, allowing processes to have a virtual address space larger than the actual physical memory.

Or swipe the card

27 cards

  1. What is virtual memory?

    A memory management technique that creates a logical memory space distinct from physical memory, allowing processes to have a virtual address space larger than the actual physical memory.

  2. What are three benefits of using virtual memory?

    1. Programs larger than physical memory can run. 2. Higher CPU utilization by allowing more processes to run concurrently. 3. Faster program startup since only needed pages are loaded initially.
  3. How is the virtual address space structured in virtual memory?

    The virtual address space starts at 0 and is divided into fixed-sized pages, similar to how physical memory is divided into frames.

  4. What is a page table and what information does it contain?

    A page table maps virtual pages to physical frames. Each entry contains a frame number and a valid/invalid bit indicating whether the page is in physical memory.

  5. What is demand paging?

    A technique where pages are loaded into physical memory only when they are actually needed (on demand), rather than loading the entire process at startup.

  6. What is pure demand paging?

    A paging strategy where no pages are initially loaded into memory; the first instruction causes a page fault, which then brings in the required page.

  7. What is locality of reference in the context of virtual memory?

    The tendency of a program to access a small set of pages repeatedly within a short time period, such as loops or localized data accesses.

  8. What is a page fault?

    An interrupt that occurs when a process references a page that is not currently in physical memory (the valid bit is 0 in the page table).

  9. Describe the steps taken to handle a page fault.

    1. Trap to the OS (page fault). 2. Verify the reference is legal. 3. Find a free frame in physical memory (or select a victim page to swap out). 4. Issue I/O to load the required page from disk (swap space) into the frame. 5. Update the page table to set the valid bit and record the frame number. 6. Restart the interrupted instruction.
  10. What happens to the process state during a page fault?

    The process goes into a waiting queue until the page is loaded from disk, then it is placed back in the ready queue to resume execution.

  11. What is the effective access time (EAT) formula in demand paging?

    EAT=(1−p)imesMA+pimesPFSEAT = (1 - p) imes MA + p imes PFSEAT=(1−p)imesMA+pimesPFS, where ppp is the page fault probability, MAMAMA is memory access time, and PFSPFSPFS is page fault service time (including disk I/O).

  12. What is swap space and how does it relate to virtual memory?

    Swap space is a dedicated area on disk used to store pages that are not currently in physical memory. It acts as the backing store for virtual memory, enabling the system to swap pages in and out.

  13. What is a dirty bit (or modify bit) and why is it important?

    A dirty bit indicates whether a page has been modified (written to) since it was loaded into memory. If clean, the page can be discarded without writing back; if dirty, it must be written to swap space when evicted.

  14. What is page replacement and when is it necessary?

    Page replacement is the process of selecting a victim page to evict from physical memory when a page fault occurs and no free frame is available, to make room for the requested page.

  15. How does the FIFO page replacement algorithm work?

    FIFO (First-In, First-Out) chooses the page that was loaded into memory the earliest (oldest) as the victim. It maintains a queue of pages in the order they were brought in.

  16. What is Belady's anomaly?

    Belady's anomaly is the counterintuitive phenomenon where, under certain page reference patterns, increasing the number of physical frames can lead to more page faults, observed with FIFO replacement.

  17. What is the optimal page replacement algorithm?

    The optimal algorithm (also called MIN) selects the page that will not be used for the longest time in the future. It achieves the minimum possible page fault rate.

  18. How does the LRU page replacement algorithm work?

    LRU (Least Recently Used) replaces the page that has not been accessed for the longest time. It tracks the access order of pages.

  19. What is the relationship between the number of frames and page faults?

    Generally, increasing the number of frames reduces the page fault rate because more pages can be kept in memory. However, under FIFO, Belady's anomaly can cause an increase.

  20. What is thrashing?

    Thrashing is a state where the system spends most of its time swapping pages in and out of memory, leading to very low CPU utilization and severe degradation of performance.

  21. What is the page fault frequency (PFF) approach to thrashing?

    The PFF approach monitors the page fault rate of processes. If the rate exceeds a high threshold, the process may need more frames (increase working set); if below a low threshold, frames can be taken away. If thrashing is detected, processes may be suspended.

  22. What is a working set?

    The working set of a process is the set of distinct pages that have been referenced in the most recent DeltaDeltaDelta time window (e.g., the last few page references). It represents the current locality of the process.

  23. How does process locality relate to thrashing?

    Processes tend to execute in localities (clusters of pages) and migrate between them. If the total size of the active localities exceeds physical memory, thrashing occurs.

  24. How can thrashing be prevented?

    Ensure that the total working set size of all processes fits within physical memory. If thrashing occurs, suspend one or more processes to reduce memory demand until the working sets fit.

  25. What is demand paging with clustering as used in Windows?

    When a page fault occurs and a page is loaded, the OS also loads several adjacent pages (clusters) together, exploiting locality to reduce future page faults.

  26. How does Windows manage working sets with minimum and maximum limits?

    Each process has a minimum guaranteed working set size and a maximum limit. When free memory is low, the OS trims the working sets of processes (reduces allocated frames) to reclaim memory.

  27. What does Windows do when free memory falls below a threshold?

    It trims the working sets of processes, reducing the number of frames allocated to each process, to free up physical memory for other uses or to avoid thrashing.

Card 1 of 27
Card 1 of 27

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent