操作系统LEC6-存储管理

上传人:w****i 文档编号:92748526 上传时间:2019-07-12 格式:PPTX 页数:44 大小:1.61MB
返回 下载 相关 举报
操作系统LEC6-存储管理_第1页
第1页 / 共44页
操作系统LEC6-存储管理_第2页
第2页 / 共44页
操作系统LEC6-存储管理_第3页
第3页 / 共44页
操作系统LEC6-存储管理_第4页
第4页 / 共44页
操作系统LEC6-存储管理_第5页
第5页 / 共44页
点击查看更多>>
资源描述

《操作系统LEC6-存储管理》由会员分享,可在线阅读,更多相关《操作系统LEC6-存储管理(44页珍藏版)》请在金锄头文库上搜索。

1、Operating System,Lecture Six Memory Management School of Software Nanjing University,本主题教学目标,掌握存储管理的基本内容 掌握固定分区存储管理 掌握可变分区存储管理 掌握对换、重定位、地址等概念 初步掌握页式存储管理 初步掌握段式存储管理,Memory Management,Introduction to Memory Management Fixed Partitioning Dynamic Partitioning Relocation Paging Segmentation,Memory Manage

2、ment,Subdividing memory to accommodate multiple processes Memory needs to be allocated efficiently to pack as many processes into memory as possible,Memory Management Requirements,Relocation Programmer does not know where the program will be placed in memory when it is executed While the program is

3、executing, it may be swapped to disk and returned to main memory at a different location (relocated) Memory references must be translated in the code to actual physical memory address,Addressing Requirements for a Process,Memory Management Requirements,Protection Processes should not be able to refe

4、rence memory locations in another process without permission Impossible to check absolute addresses in programs since the program could be relocated Must be checked during execution,Memory Management Requirements,Sharing Allow several processes to access the same portion of memory Better to allow ea

5、ch process (person) access to the same copy of the program rather than have their own separate copy,Memory Management Requirements,Logical Organization Programs are written in modules Modules can be written and compiled independently Different degrees of protection given to modules (read-only, execu

6、te-only) Share modules,Memory Management Requirements,Physical Organization Memory available for a program plus its data may be insufficient Overlaying allows various modules to be assigned the same region of memory Programmer does not know how much space will be available,Memory Management,Introduc

7、tion to Memory Management Fixed Partitioning Dynamic Partitioning Relocation Paging Segmentation,Fixed Partitioning,Fixed partitions: Equal-size and Unequal-size any process whose size is less than or equal to the partition size can be loaded into an available partition if all partitions are full, t

8、he operating system can swap a process out of a partition a program may not fit in a partition. The programmer must design the program with overlays,Fixed Partitioning,Main memory use is inefficient. Any program, no matter how small, occupies an entire partition. This is called internal fragmentatio

9、n.,Example of Fixed Partitioning,Placement Algorithm with Partitions,Equal-size partitions because all partitions are of equal size, it does not matter which partition is used Unequal-size partitions can assign each process to the smallest partition within which it will fit queue for each partition

10、processes are assigned in such a way as to minimize wasted memory within a partition,Allocate Memory in Fixed Partitioning,Memory Management,Introduction to Memory Management Fixed Partitioning Dynamic Partitioning Relocation Paging Segmentation,Dynamic Partitioning,Partitions are of variable length

11、 and number Process is allocated exactly as much memory as required Eventually get holes in the memory. This is called external fragmentation Must use compaction to shift processes so they are contiguous and all free memory is in one block,The Effect of Dynamic Partitioning,The Effect of Dynamic Par

12、titioning,Allocate memory in Dynamic Partitioning,table for free partitions table for occupy partitions,Dynamic Partitioning Placement Algorithm,Operating system must decide which free block to allocate to a process Best-fit algorithm Chooses the block that is closest in size to the request Worst pe

13、rformer overall Since smallest block is found for process, the smallest amount of fragmentation is left memory compaction must be done more often,Dynamic Partitioning Placement Algorithm,First-fit algorithm Fastest May have many process loaded in the front end of memory that must be searched over wh

14、en trying to find a free block,Dynamic Partitioning Placement Algorithm,Next-fit More often allocate a block of memory at the end of memory where the largest block is found The largest block of memory is broken up into smaller blocks Compaction is required to obtain a large block at the end of memor

15、y,Memory Management,Introduction to Memory Management Fixed Partitioning Dynamic Partitioning Relocation Paging Segmentation,Relocation,When program loaded into memory the actual (absolute) memory locations are determined A process may occupy different partitions which means different absolute memor

16、y locations during execution (from swapping) Compaction will also cause a program to occupy a different partition which means different absolute memory locations,Addresses,Logical reference to a memory location independent of the current assignment of data to memory translation must be made to the physical address Relative address expressed as a location relative to some known point Physical the absolute address or actual location in main memory,Registers Used during Execution,Base register sta

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 高等教育 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号