SlideShare una empresa de Scribd logo
1 de 26
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition,
Chapter 8: Main Memory
8.2 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
BACKGROUND
8.3 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Background
 Program must be brought (from disk) into memory and
placed within a process for it to be run
 Main memory and registers are only storage CPU can
access directly
 Register access in one CPU clock (or less)
 Main memory can take many cycles
 Cache sits between main memory and CPU registers
 Protection of memory required to ensure correct operation
8.4 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Base and Limit Registers
 A pair of base and limit registers define the logical address
space
8.5 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Base and Limit Registers
8.6 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Binding of Instructions and Data to Memory
 Address binding of instructions and data to memory
addresses can happen at three different stages
 Compile time: If memory location known a priori, absolute
code can be generated; must recompile code if starting
location changes
 Load time: Must generate relocatable code if memory
location is not known at compile time
 Execution time: Binding delayed until run time if the process
can be moved during its execution from one memory segment
to another. Need hardware support for address maps (e.g.,
base and limit registers)
8.7 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Multistep Processing of a User Program
8.8 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Logical vs. Physical Address Space
 The concept of a logical address space that is bound to
a separate physical address space is central to proper
memory management
 Logical address – generated by the CPU; also
referred to as virtual address
 Physical address – address seen by the memory
unit
 Logical and physical addresses are the same in compile-
time and load-time address-binding schemes; logical
(virtual) and physical addresses differ in execution-time
address-binding scheme
8.9 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Memory-Management Unit (MMU)
 Hardware device that maps virtual to physical address
 In MMU scheme, the value in the relocation register is added
to every address generated by a user process at the time it
is sent to memory
 The user program deals with logical addresses; it never
sees the real physical addresses
8.10 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Dynamic relocation using a relocation register
8.11 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Dynamic Loading
 Routine is not loaded until it is called
 Better memory-space utilization; unused routine is never
loaded
 Useful when large amounts of code are needed to handle
infrequently occurring cases
 No special support from the operating system is required
implemented through program design
8.12 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Dynamic Linking
 Linking postponed until execution time
 Small piece of code, stub, used to locate the
appropriate memory-resident library routine
 Stub replaces itself with the address of the routine, and
executes the routine
 Operating system needed to check if routine is in
processes’ memory address
 Dynamic linking is particularly useful for libraries
 System also known as shared libraries
8.13 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
SWAPPING
8.14 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Swapping
 A process must be in memory to be executed. A process,
however, can be swapped temporarily out of memory to a
backing store, and then brought back into memory for
continued execution
8.15 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Schematic View of Swapping
8.16 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Swapping
 Backing store – fast disk large enough to accommodate
copies of all memory images for all users; must provide
direct access to these memory images
 System maintains a ready queue of ready-to-run
processes which have memory images on disk
 Roll out, roll in – swapping variant used for priority-based
scheduling algorithms; lower-priority process is swapped out
so higher-priority process can be loaded and executed
 Major part of swap time is transfer time; total transfer time
is directly proportional to the amount of memory swapped
 Modified versions of swapping are found on many systems
(i.e., UNIX, Linux, and Windows)
8.17 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Swapping
 Problem: If the I/O is asynchronously accessing the user
memory for I/O buffers, then the process cannot be
swapped.
 Never swap a process with a pending I/O
 Execute I/O operations only into operating system
buffers.
8.18 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
CONTIGUOUS MEMORY
8.19 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Contiguous Allocation
 Main memory usually into two partitions:
 Resident operating system, usually held in low memory
with interrupt vector
 User processes then held in high memory
 Relocation registers used to protect user processes from
each other, and from changing operating-system code and
data
 Base register contains value of smallest physical
address
 Limit register contains range of logical addresses – each
logical address must be less than the limit register
 MMU maps logical address dynamically
8.20 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Hardware Support for Relocation and Limit Registers
8.21 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Contiguous Allocation (Cont)
 Multiple-partition allocation
 Hole – block of available memory; holes of various size
are scattered throughout memory
 When a process arrives, it is allocated memory from a
hole large enough to accommodate it
 Operating system maintains information about:
a) allocated partitions b) free partitions (hole)
OS
process 5
process 8
process 2
OS
process 5
process 2
OS
process 5
process 2
OS
process 5
process 9
process 2
process 9
process 10
8.22 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Dynamic Storage-Allocation Problem
 First-fit: Allocate the first hole that is big enough
 Best-fit: Allocate the smallest hole that is big enough; must
search entire list, unless ordered by size
 Produces the smallest leftover hole
 Worst-fit: Allocate the largest hole; must also search entire
list
 Produces the largest leftover hole
How to satisfy a request of size n from a list of free holes
First-fit and best-fit better than worst-fit in terms of speed
and storage utilization
8.23 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
FRAGMENTATION
8.24 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Fragmentation
 External Fragmentation – total memory space exists to satisfy a
request, but it is not contiguous
 Reduce external fragmentation by compaction
 Shuffle memory contents to place all free memory together in
one large block
 Compaction is possible only if relocation is dynamic, and is
done at execution time
 I/O problem
 Latch job in memory while it is involved in I/O
 Do I/O only into OS buffers
8K 12K 22K 8K 31K 5K 43K
63K
8.25 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Fragmentation
 Internal Fragmentation – allocated memory may be slightly larger
than requested memory; this size difference is memory internal to a
partition, but not being used
Equal size Partitioning Unequal Size Partitioning
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition,
End of Chapter 8 (part 1)

Más contenido relacionado

La actualidad más candente

Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory managementrprajat007
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSKumar Pritam
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structuresMukesh Chinta
 
Computer architecture multi processor
Computer architecture multi processorComputer architecture multi processor
Computer architecture multi processorMazin Alwaaly
 
Unit II - 3 - Operating System - Process Synchronization
Unit II - 3 - Operating System - Process SynchronizationUnit II - 3 - Operating System - Process Synchronization
Unit II - 3 - Operating System - Process Synchronizationcscarcas
 
Multithreading: Exploiting Thread-Level Parallelism to Improve Uniprocessor ...
Multithreading: Exploiting Thread-Level  Parallelism to Improve Uniprocessor ...Multithreading: Exploiting Thread-Level  Parallelism to Improve Uniprocessor ...
Multithreading: Exploiting Thread-Level Parallelism to Improve Uniprocessor ...Ahmed kasim
 
Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Ra'Fat Al-Msie'deen
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9myrajendra
 
Operating System - Unit I - Introduction
Operating System - Unit I - IntroductionOperating System - Unit I - Introduction
Operating System - Unit I - Introductioncscarcas
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating SystemsRitu Ranjan Shrivastwa
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentationhamza haseeb
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Mukesh Chinta
 
Multithreading
MultithreadingMultithreading
MultithreadingA B Shinde
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsWayne Jones Jnr
 
Operating Systems Chapter 6 silberschatz
Operating Systems Chapter 6 silberschatzOperating Systems Chapter 6 silberschatz
Operating Systems Chapter 6 silberschatzGiulianoRanauro
 
Chapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatzChapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatzGiulianoRanauro
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt Arpita Naik
 

La actualidad más candente (20)

Memory management
Memory managementMemory management
Memory management
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Cs8493 unit 4
Cs8493 unit 4Cs8493 unit 4
Cs8493 unit 4
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structures
 
Computer architecture multi processor
Computer architecture multi processorComputer architecture multi processor
Computer architecture multi processor
 
Unit II - 3 - Operating System - Process Synchronization
Unit II - 3 - Operating System - Process SynchronizationUnit II - 3 - Operating System - Process Synchronization
Unit II - 3 - Operating System - Process Synchronization
 
Multithreading: Exploiting Thread-Level Parallelism to Improve Uniprocessor ...
Multithreading: Exploiting Thread-Level  Parallelism to Improve Uniprocessor ...Multithreading: Exploiting Thread-Level  Parallelism to Improve Uniprocessor ...
Multithreading: Exploiting Thread-Level Parallelism to Improve Uniprocessor ...
 
Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9
 
Operating System - Unit I - Introduction
Operating System - Unit I - IntroductionOperating System - Unit I - Introduction
Operating System - Unit I - Introduction
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage Systems
 
Operating Systems Chapter 6 silberschatz
Operating Systems Chapter 6 silberschatzOperating Systems Chapter 6 silberschatz
Operating Systems Chapter 6 silberschatz
 
Chapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatzChapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatz
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt
 

Destacado (20)

Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Basic Blocks and Flow Graphs
Basic Blocks and Flow GraphsBasic Blocks and Flow Graphs
Basic Blocks and Flow Graphs
 
Memory management
Memory managementMemory management
Memory management
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Presentation on memory
Presentation on memoryPresentation on memory
Presentation on memory
 
Internal components storage devices
Internal components storage devicesInternal components storage devices
Internal components storage devices
 
OSCh9
OSCh9OSCh9
OSCh9
 
External & Internal Storage Device ! Batra Computer Centre
External & Internal Storage Device ! Batra Computer CentreExternal & Internal Storage Device ! Batra Computer Centre
External & Internal Storage Device ! Batra Computer Centre
 
OSCh10
OSCh10OSCh10
OSCh10
 
Memory+management
Memory+managementMemory+management
Memory+management
 
Impact internet en sociale media op bijna alles
Impact internet en sociale media op bijna allesImpact internet en sociale media op bijna alles
Impact internet en sociale media op bijna alles
 
Upper OSI Layers
Upper OSI LayersUpper OSI Layers
Upper OSI Layers
 
Template 1 ch5
Template 1 ch5Template 1 ch5
Template 1 ch5
 
Threads 2x[1]
Threads 2x[1]Threads 2x[1]
Threads 2x[1]
 
Template 1 ch3
Template 1 ch3Template 1 ch3
Template 1 ch3
 
Semantic Networks for business
Semantic Networks for businessSemantic Networks for business
Semantic Networks for business
 
Ch8 of OS
Ch8 of OSCh8 of OS
Ch8 of OS
 
Ch1-Operating System Concepts
Ch1-Operating System ConceptsCh1-Operating System Concepts
Ch1-Operating System Concepts
 
Ch1
Ch1Ch1
Ch1
 
Main memory-2 (ch8,os)
Main memory-2 (ch8,os)Main memory-2 (ch8,os)
Main memory-2 (ch8,os)
 

Similar a Main Memory

ch8-1 (final Memory).pptx
ch8-1 (final Memory).pptxch8-1 (final Memory).pptx
ch8-1 (final Memory).pptxAnamRiaz31
 
OS memory management
OS memory management OS memory management
OS memory management laiba29012
 
ch8.pdf operating systems by galvin to learn
ch8.pdf operating systems by  galvin to learnch8.pdf operating systems by  galvin to learn
ch8.pdf operating systems by galvin to learnrajitha ellandula
 
OS Memory Management.pptx
OS Memory Management.pptxOS Memory Management.pptx
OS Memory Management.pptxAkshimaPurohit
 
Main memory operating system
Main memory   operating systemMain memory   operating system
Main memory operating systemIndhu Periys
 
The Council of Architecture (COA) has been constituted by the Government of I...
The Council of Architecture (COA) has been constituted by the Government of I...The Council of Architecture (COA) has been constituted by the Government of I...
The Council of Architecture (COA) has been constituted by the Government of I...OvhayKumar1
 
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgt
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgtch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgt
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgtaaravjamela
 
memory management.ppt
memory management.pptmemory management.ppt
memory management.pptAVUDAI1
 
ch8.ppt pptptptpptptptptpttttttttttttttttttttttttttt
ch8.ppt pptptptpptptptptptttttttttttttttttttttttttttch8.ppt pptptptpptptptptpttttttttttttttttttttttttttt
ch8.ppt pptptptpptptptptptttttttttttttttttttttttttttAmullyaPatil
 
cs8493 - operating systems unit 3
cs8493 - operating systems unit 3cs8493 - operating systems unit 3
cs8493 - operating systems unit 3SIMONTHOMAS S
 
ch1 operating system chapter 1 to OS.pptx
ch1 operating system chapter 1  to OS.pptxch1 operating system chapter 1  to OS.pptx
ch1 operating system chapter 1 to OS.pptxZahoorahmed536759
 
Ch1 Operating System
Ch1 Operating System Ch1 Operating System
Ch1 Operating System ChhayaShelake
 

Similar a Main Memory (20)

ch8-1 (final Memory).pptx
ch8-1 (final Memory).pptxch8-1 (final Memory).pptx
ch8-1 (final Memory).pptx
 
OS memory management
OS memory management OS memory management
OS memory management
 
ch9.pptx
ch9.pptxch9.pptx
ch9.pptx
 
ch9.pptx
ch9.pptxch9.pptx
ch9.pptx
 
ch8.pdf operating systems by galvin to learn
ch8.pdf operating systems by  galvin to learnch8.pdf operating systems by  galvin to learn
ch8.pdf operating systems by galvin to learn
 
OS Memory Management.pptx
OS Memory Management.pptxOS Memory Management.pptx
OS Memory Management.pptx
 
ch8.ppt
ch8.pptch8.ppt
ch8.ppt
 
ch8 (2).ppt
ch8 (2).pptch8 (2).ppt
ch8 (2).ppt
 
Main memory operating system
Main memory   operating systemMain memory   operating system
Main memory operating system
 
The Council of Architecture (COA) has been constituted by the Government of I...
The Council of Architecture (COA) has been constituted by the Government of I...The Council of Architecture (COA) has been constituted by the Government of I...
The Council of Architecture (COA) has been constituted by the Government of I...
 
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgt
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgtch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgt
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgt
 
ch8.ppt
ch8.pptch8.ppt
ch8.ppt
 
memory management.ppt
memory management.pptmemory management.ppt
memory management.ppt
 
ch8.ppt pptptptpptptptptpttttttttttttttttttttttttttt
ch8.ppt pptptptpptptptptptttttttttttttttttttttttttttch8.ppt pptptptpptptptptpttttttttttttttttttttttttttt
ch8.ppt pptptptpptptptptpttttttttttttttttttttttttttt
 
cs8493 - operating systems unit 3
cs8493 - operating systems unit 3cs8493 - operating systems unit 3
cs8493 - operating systems unit 3
 
Ch1-Operating System Concept
Ch1-Operating System ConceptCh1-Operating System Concept
Ch1-Operating System Concept
 
Operating System
Operating SystemOperating System
Operating System
 
ch1.pdf
ch1.pdfch1.pdf
ch1.pdf
 
ch1 operating system chapter 1 to OS.pptx
ch1 operating system chapter 1  to OS.pptxch1 operating system chapter 1  to OS.pptx
ch1 operating system chapter 1 to OS.pptx
 
Ch1 Operating System
Ch1 Operating System Ch1 Operating System
Ch1 Operating System
 

Más de Jenny Galino

Más de Jenny Galino (6)

Heap Management
Heap ManagementHeap Management
Heap Management
 
Semantic Networks
Semantic NetworksSemantic Networks
Semantic Networks
 
Genetically Modified Food
Genetically Modified FoodGenetically Modified Food
Genetically Modified Food
 
Geometry
GeometryGeometry
Geometry
 
Hierarchical Memory System
Hierarchical Memory SystemHierarchical Memory System
Hierarchical Memory System
 
Knapsack Problem
Knapsack ProblemKnapsack Problem
Knapsack Problem
 

Último

一比一定(购)国立南方理工学院毕业证(Southern毕业证)成绩单学位证
一比一定(购)国立南方理工学院毕业证(Southern毕业证)成绩单学位证一比一定(购)国立南方理工学院毕业证(Southern毕业证)成绩单学位证
一比一定(购)国立南方理工学院毕业证(Southern毕业证)成绩单学位证wpkuukw
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证tufbav
 
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信oopacde
 
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一uodye
 
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptxCRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptxRishabh332761
 
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证ehyxf
 
一比一维多利亚大学毕业证(victoria毕业证)成绩单学位证如何办理
一比一维多利亚大学毕业证(victoria毕业证)成绩单学位证如何办理一比一维多利亚大学毕业证(victoria毕业证)成绩单学位证如何办理
一比一维多利亚大学毕业证(victoria毕业证)成绩单学位证如何办理uodye
 
Point of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratoryPoint of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratoryoyebolasonuga14
 
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制uodye
 
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一ougvy
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证ehyxf
 
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证tufbav
 
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...gajnagarg
 
LANDSLIDE MONITORING AND ALERT SYSTEM FINAL YEAR PROJECT BROCHURE
LANDSLIDE MONITORING AND ALERT SYSTEM FINAL YEAR PROJECT BROCHURELANDSLIDE MONITORING AND ALERT SYSTEM FINAL YEAR PROJECT BROCHURE
LANDSLIDE MONITORING AND ALERT SYSTEM FINAL YEAR PROJECT BROCHUREF2081syahirahliyana
 
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...drmarathore
 
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证wpkuukw
 
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证wpkuukw
 
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证ehyxf
 

Último (20)

一比一定(购)国立南方理工学院毕业证(Southern毕业证)成绩单学位证
一比一定(购)国立南方理工学院毕业证(Southern毕业证)成绩单学位证一比一定(购)国立南方理工学院毕业证(Southern毕业证)成绩单学位证
一比一定(购)国立南方理工学院毕业证(Southern毕业证)成绩单学位证
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
 
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
 
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pillsIn Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
 
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一
 
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptxCRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
 
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证
 
一比一维多利亚大学毕业证(victoria毕业证)成绩单学位证如何办理
一比一维多利亚大学毕业证(victoria毕业证)成绩单学位证如何办理一比一维多利亚大学毕业证(victoria毕业证)成绩单学位证如何办理
一比一维多利亚大学毕业证(victoria毕业证)成绩单学位证如何办理
 
Point of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratoryPoint of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratory
 
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
 
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
 
Abortion pills in Jeddah |+966572737505 | Get Cytotec
Abortion pills in Jeddah |+966572737505 | Get CytotecAbortion pills in Jeddah |+966572737505 | Get Cytotec
Abortion pills in Jeddah |+966572737505 | Get Cytotec
 
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
 
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
 
LANDSLIDE MONITORING AND ALERT SYSTEM FINAL YEAR PROJECT BROCHURE
LANDSLIDE MONITORING AND ALERT SYSTEM FINAL YEAR PROJECT BROCHURELANDSLIDE MONITORING AND ALERT SYSTEM FINAL YEAR PROJECT BROCHURE
LANDSLIDE MONITORING AND ALERT SYSTEM FINAL YEAR PROJECT BROCHURE
 
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
 
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
 
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
 
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
 

Main Memory

  • 1. Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition, Chapter 8: Main Memory
  • 2. 8.2 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition BACKGROUND
  • 3. 8.3 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Background  Program must be brought (from disk) into memory and placed within a process for it to be run  Main memory and registers are only storage CPU can access directly  Register access in one CPU clock (or less)  Main memory can take many cycles  Cache sits between main memory and CPU registers  Protection of memory required to ensure correct operation
  • 4. 8.4 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Base and Limit Registers  A pair of base and limit registers define the logical address space
  • 5. 8.5 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Base and Limit Registers
  • 6. 8.6 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Binding of Instructions and Data to Memory  Address binding of instructions and data to memory addresses can happen at three different stages  Compile time: If memory location known a priori, absolute code can be generated; must recompile code if starting location changes  Load time: Must generate relocatable code if memory location is not known at compile time  Execution time: Binding delayed until run time if the process can be moved during its execution from one memory segment to another. Need hardware support for address maps (e.g., base and limit registers)
  • 7. 8.7 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Multistep Processing of a User Program
  • 8. 8.8 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Logical vs. Physical Address Space  The concept of a logical address space that is bound to a separate physical address space is central to proper memory management  Logical address – generated by the CPU; also referred to as virtual address  Physical address – address seen by the memory unit  Logical and physical addresses are the same in compile- time and load-time address-binding schemes; logical (virtual) and physical addresses differ in execution-time address-binding scheme
  • 9. 8.9 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Memory-Management Unit (MMU)  Hardware device that maps virtual to physical address  In MMU scheme, the value in the relocation register is added to every address generated by a user process at the time it is sent to memory  The user program deals with logical addresses; it never sees the real physical addresses
  • 10. 8.10 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Dynamic relocation using a relocation register
  • 11. 8.11 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Dynamic Loading  Routine is not loaded until it is called  Better memory-space utilization; unused routine is never loaded  Useful when large amounts of code are needed to handle infrequently occurring cases  No special support from the operating system is required implemented through program design
  • 12. 8.12 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Dynamic Linking  Linking postponed until execution time  Small piece of code, stub, used to locate the appropriate memory-resident library routine  Stub replaces itself with the address of the routine, and executes the routine  Operating system needed to check if routine is in processes’ memory address  Dynamic linking is particularly useful for libraries  System also known as shared libraries
  • 13. 8.13 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition SWAPPING
  • 14. 8.14 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Swapping  A process must be in memory to be executed. A process, however, can be swapped temporarily out of memory to a backing store, and then brought back into memory for continued execution
  • 15. 8.15 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Schematic View of Swapping
  • 16. 8.16 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Swapping  Backing store – fast disk large enough to accommodate copies of all memory images for all users; must provide direct access to these memory images  System maintains a ready queue of ready-to-run processes which have memory images on disk  Roll out, roll in – swapping variant used for priority-based scheduling algorithms; lower-priority process is swapped out so higher-priority process can be loaded and executed  Major part of swap time is transfer time; total transfer time is directly proportional to the amount of memory swapped  Modified versions of swapping are found on many systems (i.e., UNIX, Linux, and Windows)
  • 17. 8.17 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Swapping  Problem: If the I/O is asynchronously accessing the user memory for I/O buffers, then the process cannot be swapped.  Never swap a process with a pending I/O  Execute I/O operations only into operating system buffers.
  • 18. 8.18 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition CONTIGUOUS MEMORY
  • 19. 8.19 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Contiguous Allocation  Main memory usually into two partitions:  Resident operating system, usually held in low memory with interrupt vector  User processes then held in high memory  Relocation registers used to protect user processes from each other, and from changing operating-system code and data  Base register contains value of smallest physical address  Limit register contains range of logical addresses – each logical address must be less than the limit register  MMU maps logical address dynamically
  • 20. 8.20 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Hardware Support for Relocation and Limit Registers
  • 21. 8.21 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Contiguous Allocation (Cont)  Multiple-partition allocation  Hole – block of available memory; holes of various size are scattered throughout memory  When a process arrives, it is allocated memory from a hole large enough to accommodate it  Operating system maintains information about: a) allocated partitions b) free partitions (hole) OS process 5 process 8 process 2 OS process 5 process 2 OS process 5 process 2 OS process 5 process 9 process 2 process 9 process 10
  • 22. 8.22 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Dynamic Storage-Allocation Problem  First-fit: Allocate the first hole that is big enough  Best-fit: Allocate the smallest hole that is big enough; must search entire list, unless ordered by size  Produces the smallest leftover hole  Worst-fit: Allocate the largest hole; must also search entire list  Produces the largest leftover hole How to satisfy a request of size n from a list of free holes First-fit and best-fit better than worst-fit in terms of speed and storage utilization
  • 23. 8.23 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition FRAGMENTATION
  • 24. 8.24 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Fragmentation  External Fragmentation – total memory space exists to satisfy a request, but it is not contiguous  Reduce external fragmentation by compaction  Shuffle memory contents to place all free memory together in one large block  Compaction is possible only if relocation is dynamic, and is done at execution time  I/O problem  Latch job in memory while it is involved in I/O  Do I/O only into OS buffers 8K 12K 22K 8K 31K 5K 43K 63K
  • 25. 8.25 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Fragmentation  Internal Fragmentation – allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used Equal size Partitioning Unequal Size Partitioning
  • 26. Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition, End of Chapter 8 (part 1)