Memory Management - contiguous allocation, swapping, paging, segmentation, demand paging, page replacement, thrashing, memory-mapped files - Question Bank

1. What is the main challenge in implementing pure segmentation efficiently?
A) Managing variable-sized segments and avoiding external fragmentation
B) Handling page faults
C) Maintaining large page tables
D) Ensuring contiguous allocation
2. Which memory management technique allows sharing of memory segments between processes?
A) Paging with no sharing
B) Pure Contiguous Allocation
C) Segmentation
D) Fixed-size partitioning
3. A system with a low degree of multiprogramming is less likely to experience:
A) External fragmentation
B) Thrashing
C) Internal fragmentation
D) Page table overhead
4. What is the 'degree of multiprogramming' in the context of memory management?
A) The number of different programs running on the system
B) The number of processes currently residing in main memory
C) The size of the largest process
D) The speed of the CPU
5. Which of the following is a common technique to reduce the overhead of page table lookups?
A) Using larger page sizes
B) Implementing a Translation Lookaside Buffer (TLB)
C) Increasing the degree of multiprogramming
D) Disabling demand paging
6. What is the primary difference between paging and segmentation?
A) Paging divides memory into fixed-size pages, while segmentation divides it into variable-size segments based on logical program structure.
B) Paging uses hardware for address translation, while segmentation uses software.
C) Paging eliminates external fragmentation, while segmentation eliminates internal fragmentation.
D) Paging requires contiguous memory, while segmentation does not.
7. When a page with a dirty bit set to '1' is replaced, what must the operating system do?
A) Discard the page
B) Write the page back to secondary storage before loading a new page
C) Simply remove it from memory
D) Mark it as clean
8. What is the primary role of the 'dirty bit' (or modification bit) in a page table entry?
A) To indicate if the page has been referenced
B) To indicate if the page has been modified since it was loaded into memory
C) To mark the page as invalid
D) To store the page's access permissions
9. Which memory management technique allows a process to be non-contiguous in physical memory?
A) Contiguous Allocation
B) Paging
C) Fixed Partitioning
D) Dynamic Partitioning
10. What is the main advantage of dynamic partitioning over fixed partitioning?
A) It eliminates internal fragmentation
B) It reduces external fragmentation
C) It is simpler to implement
D) It requires less memory overhead
11. A high page fault rate can indicate:
A) Efficient memory usage
B) A process accessing too many pages, potentially leading to thrashing
C) A shortage of CPU cycles
D) Successful page replacement
12. What is the 'working set' of a process?
A) The entire memory allocated to the process
B) The set of pages currently in physical memory
C) The set of pages that a process has accessed recently and is likely to access again soon
D) The pages that have been swapped out to disk
13. In the Second-Chance (Clock) page replacement algorithm, what is the role of the reference bit?
A) It indicates if the page has been modified
B) It indicates if the page has been recently accessed
C) It marks the page as free
D) It stores the page's arrival time
14. Which page replacement algorithm is often considered a good approximation of LRU?
A) FIFO
B) Optimal
C) Second-Chance (Clock) algorithm
D) Worst-Fit
15. What is the primary purpose of 'locality of reference' in relation to memory management?
A) To ensure all memory is accessed uniformly
B) To exploit the tendency of processes to access a subset of memory locations frequently over short periods
C) To minimize the use of secondary storage
D) To guarantee contiguous memory allocation
16. In a segmented paging system, what is the logical address composed of?
A) Page number and offset
B) Segment number and offset
C) Segment number, page number, and offset
D) Frame number and offset
17. If a TLB miss occurs, where does the system look for the page table entry?
A) In the CPU registers
B) In main memory (the actual page table)
C) On secondary storage directly
D) In the swap space
18. What is a Translation Lookaside Buffer (TLB)?
A) A buffer storing recently used file data
B) A cache for page table entries to speed up address translation
C) A buffer for disk I/O requests
D) A register holding the current process ID
19. Which of the following is a common implementation detail for paging hardware?
A) Segment descriptor tables
B) Memory Management Unit (MMU)
C) File allocation tables
D) Disk scheduling algorithms
20. How do memory-mapped files interact with the operating system's memory management?
A) They bypass the operating system's memory manager
B) They are treated like regular pages by the paging system, loaded on demand
C) They require dedicated physical memory allocation
D) They are exclusively managed by disk controllers
21. What is the primary benefit of using memory-mapped files?
A) To increase disk fragmentation
B) To allow processes to access file content as if it were in memory, simplifying I/O operations
C) To force contiguous allocation of file data
D) To reduce the need for RAM
22. Which of the following is a potential problem with demand paging?
A) Excessive internal fragmentation
B) High overhead due to frequent page table lookups
C) Thrashing if the degree of multiprogramming is too high or pages are too large
D) External fragmentation
23. In demand paging, when a page fault occurs, what is the operating system's responsibility?
A) To terminate the process
B) To locate the page on secondary storage, load it into a free frame, and restart the instruction
C) To allocate more memory to the process
D) To initiate swapping of the entire process
24. Which mechanism is essential for demand paging to work efficiently?
A) First-fit allocation
B) Swapping
C) Paging and a page fault handler
D) Contiguous memory allocation
25. What is demand paging?
A) Loading an entire program into memory before execution
B) Loading pages into memory only when they are needed
C) Swapping entire processes out of memory when not in use
D) Allocating fixed-size partitions to each process
26. What is a disadvantage of pure segmentation?
A) It suffers from external fragmentation
B) It leads to excessive internal fragmentation
C) It is difficult to implement
D) It requires very large page tables
27. What is a key advantage of segmentation over paging?
A) It eliminates internal fragmentation
B) It provides a natural way to share code and data among processes
C) It is simpler for the hardware to manage
D) It requires less memory overhead
28. In segmentation, what does a segment table typically contain?
A) Base address and limit of each segment
B) Page table entries
C) Frame numbers
D) CPU register values
29. What is segmentation in memory management?
A) Dividing memory into fixed-size blocks called frames
B) Dividing a program into logical units of varying sizes called segments
C) Allocating contiguous memory blocks to processes
D) Moving entire processes between RAM and disk
30. What is a common strategy to prevent or recover from thrashing?
A) Increase the number of available page replacement algorithms
B) Reduce the degree of multiprogramming
C) Increase the size of pages
D) Use a faster hard drive
31. Thrashing is often caused by:
A) Having too many processes with large memory footprints
B) An insufficient number of page replacement algorithms
C) A very fast CPU
D) Efficient memory allocation strategies
32. What is 'thrashing'?
A) A condition where a system runs out of memory
B) A state where a process spends more time paging than executing instructions
C) An error in the page table
D) The process of swapping data to disk
33. What is the primary advantage of the Optimal page replacement algorithm?
A) It is simple to implement
B) It requires minimal hardware support
C) It results in the fewest page faults
D) It has low overhead
34. LRU (Least Recently Used) page replacement algorithm aims to replace the page that:
A) Was loaded into memory most recently
B) Has not been referenced for the longest period of time
C) Was loaded into memory the earliest
D) Is currently being used by the process
35. The FIFO page replacement algorithm replaces the page that:
A) Has not been used for the longest time
B) Has been in memory the longest
C) Is used the least frequently
D) Is currently being used
36. Which of the following is NOT a common page replacement algorithm?
A) FIFO (First-In, First-Out)
B) LRU (Least Recently Used)
C) Optimal
D) Round Robin
37. What is a 'page fault'?
A) An error in the page replacement algorithm
B) When a requested page is not found in physical memory
C) A hardware failure in the memory management unit
D) When a process tries to access memory it doesn't own
38. In paging, what is a 'page table' used for?
A) To track free memory frames
B) To map logical page addresses to physical frame addresses
C) To store the content of each page
D) To manage disk I/O operations
39. What is the fundamental concept behind paging?
A) Dividing memory into variable-sized chunks
B) Dividing memory into fixed-size blocks called frames and processes into fixed-size blocks called pages
C) Allocating contiguous blocks of memory to processes
D) Moving entire processes between RAM and disk
40. Swapping involves moving entire processes between:
A) CPU registers and main memory
B) Main memory and secondary storage
C) Disk cache and main memory
D) I/O devices and main memory
41. Which memory allocation strategy aims to solve external fragmentation by moving processes in memory?
A) Paging
B) Segmentation
C) Swapping
D) Dynamic Partitioning
42. What is internal fragmentation?
A) Wasted memory in free blocks that are too small to satisfy a request
B) Wasted memory within allocated blocks due to fixed partition sizes or page/segment sizes
C) Memory that is not contiguous
D) Memory that is shared between processes
43. What is external fragmentation?
A) Wasted memory within allocated blocks
B) Wasted memory in free blocks that are too small to satisfy a request
C) Memory that is not accessible by the CPU
D) Memory allocated to the operating system kernel
44. Worst-fit algorithm in contiguous memory allocation allocates the process to:
A) The smallest available hole
B) The first available hole
C) The largest available hole
D) A hole of exactly the required size
45. The Best-fit algorithm for contiguous memory allocation attempts to minimize:
A) The size of the largest remaining hole
B) The time taken to find a suitable hole
C) The size of the smallest remaining hole
D) The number of fragmentation blocks
46. Which algorithm places the first process into the first available hole that is large enough?
A) Best-fit
B) Worst-fit
C) First-fit
D) Quick-fit
47. What is a 'hole' in the context of contiguous memory allocation?
A) A section of memory occupied by a process
B) A free block of memory that can be allocated to a process
C) A corrupted memory address
D) A protected memory region
48. In contiguous memory allocation, what is a fixed-size partition?
A) A partition whose size can change dynamically based on process needs
B) A partition with a predefined, unchanging size allocated to a process
C) A partition that can hold multiple processes simultaneously
D) A partition created only when memory is fragmented
49. What is the primary goal of memory management in an operating system?
A) To maximize CPU utilization
B) To manage and allocate main memory efficiently among competing processes
C) To ensure fast disk I/O operations
D) To handle network communication