Computer Science Exam 4

docx

School

James Madison University *

*We aren’t endorsed by this school

Course

446

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

5

Uploaded by DeaconKomodoDragon3841

Report
**Operating Systems (CS405) Exam: Memory Management** --- **Instructions:** 1. Answer all questions. 2. Write your answers in the spaces provided. 3. Ensure your responses are clear and concise. --- **Section A: Multiple Choice (1 mark each)** 1. **What is the primary function of a Memory Management Unit (MMU) in an operating system?** a) Task scheduling b) File management c) Memory protection and addressing d) Input/output control **Answer: c** 2. **Which memory allocation technique suffers from fragmentation issues?** a) First Fit b) Best Fit c) Worst Fit
d) Paging **Answer: c** 3. **What is thrashing in the context of memory management?** a) Efficient memory utilization b) Excessive paging and poor performance c) Task prioritization d) Virtual memory allocation **Answer: b** --- **Section B: True/False (1 mark each)** 4. **A page table is used in the implementation of demand paging.** **Answer: True** 5. **Fragmentation occurs only in dynamic memory allocation.** **Answer: False** --- **Section C: Short Answer (2 marks each)**
6. **Explain the difference between internal fragmentation and external fragmentation.** **Answer:** Internal fragmentation occurs when memory is allocated in fixed- size blocks, leading to wasted space within a block due to the allocation of more memory than necessary. External fragmentation, on the other hand, happens when free memory is scattered in small, non-contiguous chunks, making it challenging to allocate larger contiguous blocks. 7. **Describe the role of the Swapping technique in memory management.** **Answer:** Swapping involves moving an entire process in and out of main memory. When a process is swapped in, it gains access to the CPU, and when swapped out, it is moved to secondary storage. This technique helps in managing memory by allowing the system to run more processes than fit in the physical memory at a given time. --- **Section D: Matching (2 marks each)** Match the memory management term with its description. 8. **A. Page Table** i. Translation between logical and physical address 9. **B. Segmentation**
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
ii. Division of physical memory into fixed-sized blocks **Answers:** 8. A - i 9. B - ii --- **Section E: Essay (10 marks)** 10. **Discuss the challenges and benefits of implementing demand paging in modern operating systems. Provide examples of scenarios where demand paging is advantageous and situations where it might lead to performance issues.** *Answer:* (Answers will vary; evaluate based on the depth of understanding and coverage of key points.) --- **Answer Key:** 1. c 2. c 3. b 4. True 5. False 6. (Accept well-explained responses)
7. (Accept well-explained responses) 8. A - i 9. B - ii 10. (Evaluate based on content, coherence, and coverage of key points)