1 / 27

Operating Systems

This unit discusses different strategies for memory management in operating systems, including allocation (contiguous and noncontiguous), placement, and replacement. It also covers the drawbacks of fixed-partition allocation and the characteristics of variable-partition allocation. Furthermore, it explores techniques for reducing external fragmentation, such as coalescing and compaction. The unit concludes with an overview of memory placement strategies, including first-fit, best-fit, and worst-fit, as well as the concept of memory swapping and its impact on multi-process systems.

Download Presentation

Operating Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Operating Systems Operating Systems Unit 6: Real Memory organization management

  2. Memory Hierarchy COP 5994 - Operating Systems

  3. Memory Management Strategies • Allocation • Single or multiple processes • Fixed or variable • Fetch • Demand or anticipatory • Decides which piece of data to load next • Placement • Decides where in main memory to place incoming data • Replacement • Decides which data to remove from main memory to make more space COP 5994 - Operating Systems

  4. Memory Allocation • Contiguous allocation • single block of contiguous addresses • hard/impossible to find a large enough block • low overhead • Noncontiguous allocation • address space divided into segments • each segment can be placed in different location • easier to find “holes” in which a segment will fit • more processes can run simultaneously • offsets the overhead incurred by this technique COP 5994 - Operating Systems

  5. Single Process: Contiguous Memory Allocation COP 5994 - Operating Systems

  6. Single Process : Overlays COP 5994 - Operating Systems

  7. Single Process: Memory Protection COP 5994 - Operating Systems

  8. Multi Process: Fixed-Partition Allocation • Fixed-partition multiprogramming • Each active process receives a fixed-size block of memory • Processor rapidly switches between each process • Security becomes important COP 5994 - Operating Systems

  9. Multi Process: Fixed-Partition Allocation COP 5994 - Operating Systems

  10. Multi Process: Fixed-Partition Allocation with address translation COP 5994 - Operating Systems

  11. Multi Process: Fixed-Partition Protection COP 5994 - Operating Systems

  12. Multi Process: Fixed-Partition Drawbacks • Internal fragmentation • Process does not take up entire partition, wasting memory • Process can be too big to fit anywhere • Variable partitions designed as replacement COP 5994 - Operating Systems

  13. Multi Process: Variable-Partition Allocation COP 5994 - Operating Systems

  14. Variable-Partition Characteristics • processes placed where they fit • No space wasted initially • Internal fragmentation impossible • Partitions are exactly the size they need to be • External fragmentation occurs when process ends • Leaves holes too small for new processes • Eventually no holes large enough for new processes COP 5994 - Operating Systems

  15. Variable-Partition: memory holes COP 5994 - Operating Systems

  16. Reduce external fragmentation • Coalescing • Combine adjacent free blocks into one large block • Compaction • Rearranges memory into • one contiguous block of free space • one contiguous block of occupied space • Significant overhead COP 5994 - Operating Systems

  17. Memory coalescing COP 5994 - Operating Systems

  18. Memory compaction COP 5994 - Operating Systems

  19. Memory Placement Strategies • Where to put incoming processes • First-fit strategy • Process placed in first hole of sufficient size found • Simple, low execution-time overhead • Best-fit strategy • Process placed in hole that leaves least unused space • More execution-time overhead • Worst-fit strategy • Process placed in hole that leaves most unused space • remaining large hole may be used by another process COP 5994 - Operating Systems

  20. Memory Placement: first fit COP 5994 - Operating Systems

  21. Memory Placement: best fit COP 5994 - Operating Systems

  22. Memory Placement: worst fit COP 5994 - Operating Systems

  23. Multi process with Memory Swapping • remove inactive processes from memory • only running process is in main memory • others temporarily moved to secondary storage • maximizes available memory • significant overhead when switching processes COP 5994 - Operating Systems

  24. Multi process with Memory Swapping COP 5994 - Operating Systems

  25. Multi process with Memory Swapping • Idea: keep several processes in memory • Less available memory per process • Much faster response times • Similar to paging COP 5994 - Operating Systems

  26. Evolution of memory organization COP 5994 - Operating Systems

  27. Agenda for next week: • Midterm exam ! • In 2 weeks: • Chapter 10 & 11: Virtual Memory • Read ahead ! COP 5994 - Operating Systems

More Related