中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)09 虚拟内存 Virtual Memory

提纲 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

Background Virtual memory can be implemented via: 1.Demand paging Paging technology pager(请求调页)and page replacement Pager VS.swapper the unit of swapping in/out is not the entire process but page. 2.Demand segmentation 4口”4814在,4色,主)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Background ▶ Virtual memory can be implemented via: 1. Demand paging ▶ Paging technology + pager (请求调页) and page replacement ▶ Pager VS. swapper the unit of swapping in/out is not the entire process but page. 2. Demand segmentation

虚拟存储器的特征 1.多次性:最重要的特征 ·一个作业被分成多次装入内存运行 2.对换性 一允许在进程运行的过程中,(部分)换入换出 3.虚拟性 ·逻辑上的扩充 ·虚拟性是以多次性和对换性为基础的。 。多次性和对换性是建立在离散分配的基础上的 4口”484在4色,主月QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 虚拟存储器的特征 1. 多次性:最重要的特征 ▶ 一个作业被分成多次装入内存运行 2. 对换性 ▶ 允许在进程运行的过程中,(部分)换入换出 3. 虚拟性 ▶ 逻辑上的扩充 ▶ 虚拟性是以多次性和对换性为基础的。 ▶ 多次性和对换性是建立在离散分配的基础上的

Virtual-address Space(虚拟地址空间) The virtual address space of a process refers to the logical (or virtual)view of Max how a process is stored in memory. stack Typically:0~xxx exists in contiguous memory In fact,the physical memory are organized (partitioned)in page frames the page frames assigned to a process may not be heap contiguous→MMU data code 4口”484在4色,主月QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Virtual-address Space (虚拟地址空间) ▶ The virtual address space of a process refers to the logical (or virtual) view of how a process is stored in memory. ▶ Typically: 0~xxx & exists in contiguous memory ▶ In fact, the physical memory are organized (partitioned) in page frames & the page frames assigned to a process may not be contiguous⇒MMU Max 0 stack ❄ ✻ heap data code

Some benefits 1.Shared library using virtual memory stack stack shared library shared pages shared library heap heap data data code code 2.Shared memory 3.Speeding up process creation 4口”4814在4色,主QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Some benefits 1. Shared library using virtual memory stack stack heap heap data data code code shared library shared pages shared library 2. Shared memory 3. Speeding up process creation

Outline Demand Paging(按需调页 Basic Concepts(Hardware support) Performance of Demand Paging 4口”4814在,4色,主)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Outline Demand Paging (按需调页) Basic Concepts (Hardware support) Performance of Demand Paging
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)08 Main Memory.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)07 Deadlock.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)06 Process Synchronization.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)05 Threads.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)04 CPU Scheduling.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)03 Processes.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)02 OS Structure.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)01 CS Structure.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)01 OS overview.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)课程简介(主讲:陈香兰).pdf
- 中国科学技术大学:《高级操作系统 Advanced Operating System》课程教学资源(PPT课件讲稿)第二章 分布式路由算法(2/2).ppt
- 中国科学技术大学:《高级操作系统 Advanced Operating System》课程教学资源(PPT课件讲稿)第二章 分布式路由算法主要内容(1/2,主讲:陈香兰).ppt
- 天津开放大学:《电子商务概论》课程教学资源(试卷习题)综合练习及答案.doc
- 国家开放大学:《计算机应用基础》课程教学资源(章节习题,含答案)计算机网络应用基础练习_第三章.doc
- 国家开放大学:《计算机应用基础》课程教学资源(章节习题,含答案)计算机安全练习_第七章.doc
- 国家开放大学:《计算机应用基础》课程教学资源(章节习题,含答案)计算机基础知识练习_第一章.doc
- 国家开放大学:《计算机应用基础》课程教学资源(章节习题,含答案)Word 2010文字处理系统练习_第四章.doc
- 国家开放大学:《计算机应用基础》课程教学资源(章节习题,含答案)Windows 7操作系统及应用练习_第二章.doc
- 国家开放大学:《计算机应用基础》课程教学资源(章节习题,含答案)PowerPoint 2010电子演示文稿系统练习_第六章.doc
- 国家开放大学:《计算机应用基础》课程教学资源(章节习题,含答案)Excel 2010电子表格系统练习_第五章.doc
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)10 文件系统接口 File System Interface.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)11 File 文件系统实现 File system implementation.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)12 外存 Mass Storage Systems.pdf
- 中国科学技术大学:《操作系统原理与设计 Operating System》课程教学资源(PPT课件讲稿)13 IO管理 IO systems.pdf
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(课件讲义)GNU开发工具链简介 GNU Tools(主讲:陈香兰).pdf
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(课件讲义)基于x86的Linux启动代码分析.pdf
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(课件讲义)制作简单的Linux系统.pdf
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(PPT课件讲稿)内存寻址.ppt
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(PPT课件讲稿)Linux进程管理(1/3).ppt
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(PPT课件讲稿)Linux进程管理(2/3).ppt
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(课件讲义)中断和异常.pdf
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(课件讲义)系统调用.pdf
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(PPT课件讲稿)Linux进程管理(3/3).ppt
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(课件讲义)内存管理.pdf
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(课件讲义)Linux中的时钟和定时测量.pdf
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(课件讲义)Linux中的进程地址空间.pdf
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(课件讲义)程序的执行.pdf
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(PPT课件讲稿)文件系统.ppt
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(PPT课件讲稿)管理I/O设备.ppt
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(PPT课件讲稿)Linux中的信号机制.ppt