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

Study methods

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

Virtual Memory Explained

  • 20Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Early Memory Management
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What was the main problem with early physical addressing in computing?

Tap to flipClick to flipspace

Multiple programs could overwrite each other's memory, causing crashes and corruption. There was no memory protection, so a bug in one program could corrupt the entire system.

Or swipe the card

20 cards

  1. What was the main problem with early physical addressing in computing?

    Multiple programs could overwrite each other's memory, causing crashes and corruption. There was no memory protection, so a bug in one program could corrupt the entire system.

  2. What is external fragmentation?

    Free memory is split into small, non-contiguous holes, making it impossible to load a program larger than the largest single free block, even if total free memory is sufficient.

  3. What is the purpose of a base register?

    It stores the physical start address of a process, and the MMU adds it to every virtual address to translate it to a physical address, giving the illusion the process starts at address 0.

  4. What does a bound register do?

    It stores the size limit of a process's memory region. The MMU checks each address against the bound register; if the address is greater than or equal to the bound, a segmentation fault is raised.

  5. How does the MMU handle a memory access in base and bounds?

    The MMU first checks if the virtual address is less than the bound register. If yes, it adds the base register to the virtual address to produce the physical address and sends it to RAM. If no, it raises a segmentation fault.

  6. What is compaction in memory management?

    The OS stops all processes, moves them together in physical RAM to consolidate free space into one large contiguous block, allowing a new large process to fit.

  7. How did segmentation improve upon base and bounds?

    Segmentation allowed each logical part of a program (code, heap, stack) to have its own base and bounds, enabling separate placement and read-only permissions for code segments.

  8. Why did segmentation still suffer from external fragmentation?

    Segments were variable in size. When segments were created and destroyed, physical memory became fragmented into small holes of varying sizes, unable to fit new segments.

  9. What are pages and page frames in paging?

    Pages are fixed-size (e.g., 4KB) chunks of a process's virtual address space. Page frames are fixed-size physical memory slots of the same size. Any page can map to any free frame.

  10. What is the role of a page table?

    A page table maps virtual page numbers to physical frame numbers, acting as a per-process map that the OS uses to translate virtual addresses to physical addresses.

  11. What is internal fragmentation in paging?

    Wasted space within a page. For example, if a program needs only 1 byte, the OS allocates a full 4KB page, wasting 4095 bytes.

  12. Why does paging introduce a latency penalty?

    Every memory access requires two RAM lookups: one to read the page table entry (translation) and one to access the actual data, doubling memory access time.

  13. What is the TLB and how does it speed up address translation?

    The TLB (Translation Lookaside Buffer) is a fast hardware cache that stores recent virtual-to-physical address translations. On a TLB hit, translation occurs with no extra RAM access.

  14. What is a TLB miss?

    When a requested translation is not in the TLB, the CPU must perform a slow page table walk (reading the page table from RAM) to find the physical address and then access the data.

  15. What is demand paging?

    A memory management strategy where the OS loads only the minimal required pages of a program into RAM initially, and other pages are loaded only when accessed (on demand).

  16. What is a page fault?

    A hardware exception triggered when a program tries to access a page that is marked 'not present' in the page table. The OS handles it by loading the missing page from disk into a free RAM frame.

  17. How does the OS handle a page fault when RAM is full?

    The OS must evict a page from RAM (using a replacement policy like LRU) and write it to disk if modified, then load the faulting page into the freed frame.

  18. What is the LRU page replacement policy?

    LRU (Least Recently Used) evicts the page that has not been accessed for the longest time, based on the assumption that pages used recently are more likely to be used again.

  19. What is thrashing?

    A condition where the system spends most of its time swapping pages between RAM and disk rather than executing processes, leading to extremely slow performance.

  20. What symptom indicates a system is thrashing?

    The computer becomes extremely slow, the cursor stutters, and the hard drive activity light is solid as the OS frantically swaps pages in and out.

Card 1 of 20
Card 1 of 20

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent