提纲 Background Demand Paging(按需调页) Copy-on-Write(写时复制 Page Replacement(页面置换) Allocation of Frames Thrashing(抖动) Memory-Mapped Files Allocating Kernel Memory Other Issues Operating System Examples 小结和作业 4口”4814在4色,主)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 提纲 Background Demand Paging (按需调页) Copy-on-Write (写时复制) Page Replacement (页面置换) Allocation of Frames Thrashing (抖动) Memory-Mapped Files Allocating Kernel Memory Other Issues Operating System Examples 小结和作业
Background Instructions must be loaded into memory before execution. Solutions in chapter 8: Program entire Physical memory Sometimes,jobs may be too big or too many. How to expand the main memory? Physically?COST TOO HIGH! =Logically?√ 4口”4814在,4色,主)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Background ▶ Instructions must be loaded into memory before execution. ▶ Solutions in chapter 8: Program entire −−−−−→Physical memory ▶ Sometimes, jobs may be too big or too many. How to expand the main memory? ▶ Physically? COST TOO HIGH! ▶ Logically? √
Background Virtual memory:Why and How? Some code may get no,or only little,opportunity of execution, for example,code for error handlers Some data may get no opportunity of access Locality of reference(程序的局部性原理),1968, Denning Temporal locality(时间局部性) Spatial locality(空间局部性) Idea:partly loading(部分装入)、demand loading(按 需装入)、replacement(置换) 4口”484在4色,主月QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Background ▶ Virtual memory: Why and How? ▶ Some code may get no, or only little, opportunity of execution, for example, code for error handlers ▶ Some data may get no opportunity of access ▶ Locality of reference (程序的局部性原理), 1968, Denning ▶ Temporal locality (时间局部性) ▶ Spatial locality (空间局部性) ▶ Idea: partly loading (部分装入)、demand loading (按 需装入)、replacement (置换)
Background Virtual Memory(虚拟存储器) 是指具有请求调页功能和置换功能,能从逻辑上对内存容量 加以扩充的一种存储器系统 Logical size: 从系统角度看:内存容量+外存容量 从进程角度看:地址总线宽度范围内;内存容量+外存容量 Speed:close to main memory Cost per bit:close to secondary storage(disks) Virtual memory separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution Logical address space can therefore be much larger than physical address space Allows address spaces to be shared by several processes Allows for more efficient process creation 4口”484在4色,主月QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Background ▶ Virtual Memory (虚拟存储器) 是指具有请求调页功能和置换功能,能从逻辑上对内存容量 加以扩充的一种存储器系统 ▶ Logical size: 从系统角度看:内存容量+外存容量 从进程角度看:地址总线宽度范围内;内存容量+外存容量 ▶ Speed: close to main memory ▶ Cost per bit: close to secondary storage (disks) ▶ Virtual memory : separation of user logical memory from physical memory. ▶ Only part of the program needs to be in memory for execution ▶ Logical address space can therefore be much larger than physical address space ▶ Allows address spaces to be shared by several processes ▶ Allows for more efficient process creation
Background page0 page 1 page 2 memory map PM page v VM Diagram showing vritual memory that is larger than physical memory 4口”4814在4色,主)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Background page 0 page 1 page 2 ... page v VM memory map PM Diagram showing vritual memory that is larger than physical memory