Operating System: Question Set – 21
What is contiguous memory allocation?
Contiguous memory allocation assigns a single continuous block of memory to a process. It can be implemented as:
- Fixed Partitioning: Memory is divided into fixed-size blocks.
- Variable Partitioning: Memory is divided based on process requirements.
What are the limitations of contiguous memory allocation?
- External Fragmentation: Free memory is scattered, preventing its use for larger processes.
- Inflexibility: Fixed-size partitions may waste memory.
What is paging in memory management?
Memory is segmented by paging into fixed-size chunks known as frames (physical) and pages (logical). A page table is used to map pages to frames, removing external fragmentation.
What is segmentation in memory management?
Segmentation uses logical divisions such as code, data, and stack to split memory into variable-sized segments. Every segment has a limit and a base address.
What is virtual memory?
By using disk space as an extension of RAM, virtual memory is a memory management strategy that enables the execution of processes bigger than physical memory.
What are page replacement algorithms?
When a new page needs to be loaded into memory but no frame is free, a page replacement algorithm decides which page to remove. Common algorithms:
- FIFO (First-In-First-Out): Removes the oldest page.
- LRU (Least Recently Used): Removes the least recently accessed page.
- Optimal: Removes the page that will not be used for the longest time.
- Clock (Second Chance): Uses a reference bit to give pages a second chance.
What is thrashing?
- Internal Fragmentation: Unused memory within allocated blocks.
- External Fragmentation: Free memory scattered across the system, making it unusable for larger allocations.
What is the working set model?
The set of pages that a process regularly accesses within a predetermined time frame is defined by the working set model. It is employed to effectively manage memory allocation and reduce page faults.
What is swapping?
In order to maximize memory utilization, swapping involves moving processes from the primary memory to secondary storage (such as the disk).
What is demand paging?
Demand paging reduces initial memory allocation and speeds up application startup by loading pages into memory only when they are accessed.
What is a TLB (Translation Lookaside Buffer)?
The MMU’s TLB is a high-speed cache that expedites the conversion of logical to physical addresses by storing recent page table entries.
What is a page fault?
When a process attempts to access a page that is not in memory at the moment, it results in a page fault. The page must be loaded into memory by the operating system from secondary storage.