University of New Mexico
Main Memory 02/04/2021 Professor Amanda Bienz Textbook pages 349-360
Operating System Concepts - 10th Edition Enhanced eText Portions from Prof. Patrick Bridges’ Slides University of New Mexico Background
• Program starts in disk
• Brought into memory and placed within a process for it to be run
• Register access is done in one CPU clock cycle (or less)
• Main memory can take many cycles (hundreds) - causing a stall
• Cache : sits between main memory and CPU registers University of New Mexico Memory Virtualization
• OS virtualizes physical memory, providing illusion of separate memory space per process
• Seems like each process uses entire memory space
• Benefts :
• Ease of programming
• Memory efciency
• Guarantee isolation for user processes and OS (protection) University of New Mexico
OS in early eystems University of New Mexico Early LoadOperating only one process in memory.Systems ▪ Poor utilization and efficiency 0KB Operating System (code, data, etc.) 64KB
• Load a single process in memory
Current • Poor utilization and efciency Program (code, data, etc.)
max Physical Memory
4 University of New Mexico University of New Mexico MultiprogrammingMultiprogramming and and Time Time Sharing Sharing
0KB Operating System Load multiple processes in memory. (code, data, etc.) • Load multiple processes in memory 64KB ▪ Execute one for a short while. Free Execute one▪ Switchfor short processes time between them in memory. 128KB • Process C ▪ Increase utilization and efficiency. (code, data, etc.) 192KB Switch between processes in memory Process B • (code, data, etc.) 256KB Cause an important protection issue. Increase utilization and efciency Free • ▪ 320KB Errant memory accesses from other processes Process A (code, data, etc.) • Protection issue: 384KB Free 448KB • Errant memory accesses from other processes Free 512KB Physical Memory
5 University of New Mexico Address Space