Memory Management: Demand Paging Flashcards
What is Virtual/Logical Address Space?
It is the memory the programmer perceives their program to have.
What is Physical Address Space?
It refers to the actual location of the program within the physical memory.
List the Memory Mapping Methods.
○ Base and bounds
○ Segmentation
○ Paging
Explain Segmentation.
Segmentation enables memory sharing between processes. This is achieved by:
● Creating a segment for the shared data.
● Adding a segment entry in the segment table for each process, pointing to the shared segment in memory.
For instance, running the same program in different processes might require sharing code, or reading the same file in different processes might involve sharing memory corresponding to the file. Segmentation allows for this memory sharing that base and bounds cannot
What is the base and bounds memory mapping method?
A method of memory mapping that uses a base register to store the starting address of a process’s memory in physical memory and a bounds register to store the size of the process’s memory.
What is external fragmentation?
External fragmentation occurs when there is enough free memory to satisfy a request, but the memory is not contiguous.
What is memory compaction? What are its drawbacks?
Memory compaction is a technique used to reduce external fragmentation. It involves rearranging segments in physical memory to get rid of holes.
○ Memory compaction is expensive and inefficient.
○
What is paging? What are a page and a frame?
○ Paging is a memory mapping method that divides a process’s address space into fixed-size portions called pages and physical memory into fixed-size portions called frames.
○ The size of a page is equal to the size of a frame.
What are the two components of a virtual address in paging?
○ VPN: Virtual page number
○ Offset: offset within the page
What is a page table?
A data structure used to map virtual addresses to physical addresses. It is indexed by page number and contains the frame number of the page in memory. Each process has its own page table.
What problems arise from large page tables?
○ Page tables can become very large, especially with large address spaces.
○ A large amount of memory may be required just to store page tables.
○ Address spaces are often sparsely used, meaning that a significant portion of the page table may be unused.
○ Access to unused portions of the address space may appear valid, which is undesirable.
What is the valid/invalid bit in a page table entry?
○ A bit that indicates whether a page is currently in memory (valid) or not (invalid).
What are multi-level page tables?
○ A solution to the problem of large page tables. They use a hierarchy of page tables, where entries in higher-level page tables point to lower-level page tables.
What is internal fragmentation?
○ Internal fragmentation occurs when a portion of a page is unused.
What is the problem with paging address translation performance?
○ Paging address translation requires two memory accesses: one to access the page table and another to access the actual data.
○ This can significantly reduce performance, as memory access speeds are often a bottleneck.
What is the TLB?
○ A small, fast hardware cache that stores recent page table entries to speed up address translation.