SlideShare une entreprise Scribd logo
1  sur  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)

Contenu connexe

Tendances

8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategiesDr. Loganathan R
 
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
 
Ch9: Memory Management
Ch9: Memory ManagementCh9: Memory Management
Ch9: Memory ManagementAhmar Hashmi
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory managementrprajat007
 
Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.Muhammad SiRaj Munir
 
Chapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating SystemChapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating SystemShafaan Khaliq Bhatti
 
Operating System 3
Operating System 3Operating System 3
Operating System 3tech2click
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentationusmankiyani1
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"Ra'Fat Al-Msie'deen
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memoryMazin Alwaaly
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Chapter 2 Operating System Structures.ppt
Chapter 2 Operating System Structures.pptChapter 2 Operating System Structures.ppt
Chapter 2 Operating System Structures.pptErenJeager20
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system conceptsStarlee Lathong
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual MemoryArchith777
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecturevenkateswarlu G
 
Memory management early_systems
Memory management early_systemsMemory management early_systems
Memory management early_systemsMybej Che
 

Tendances (20)

8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"
 
Ch9: Memory Management
Ch9: Memory ManagementCh9: Memory Management
Ch9: Memory Management
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.
 
Memory management OS
Memory management OSMemory management OS
Memory management OS
 
Chapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating SystemChapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating System
 
Operating System 3
Operating System 3Operating System 3
Operating System 3
 
Memory management
Memory managementMemory management
Memory management
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Memory management
Memory managementMemory management
Memory management
 
Chapter 2 Operating System Structures.ppt
Chapter 2 Operating System Structures.pptChapter 2 Operating System Structures.ppt
Chapter 2 Operating System Structures.ppt
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system concepts
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
 
Chapter 3 - Processes
Chapter 3 - ProcessesChapter 3 - Processes
Chapter 3 - Processes
 
Cs8493 unit 4
Cs8493 unit 4Cs8493 unit 4
Cs8493 unit 4
 
Memory management early_systems
Memory management early_systemsMemory management early_systems
Memory management early_systems
 

En vedette (20)

Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Memory management
Memory managementMemory management
Memory management
 
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
Ch1Ch1
Ch1
 
Main memory-2 (ch8,os)
Main memory-2 (ch8,os)Main memory-2 (ch8,os)
Main memory-2 (ch8,os)
 

Similaire à 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
 
Operating System - Unit I - Introduction
Operating System - Unit I - IntroductionOperating System - Unit I - Introduction
Operating System - Unit I - Introductioncscarcas
 
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
 

Similaire à 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 - Unit I - Introduction
Operating System - Unit I - IntroductionOperating System - Unit I - Introduction
Operating System - Unit I - Introduction
 
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
 

Plus de Jenny Galino

Plus 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
 

Dernier

Introduction-to-4x4-SRAM-Memory-Block.pptx
Introduction-to-4x4-SRAM-Memory-Block.pptxIntroduction-to-4x4-SRAM-Memory-Block.pptx
Introduction-to-4x4-SRAM-Memory-Block.pptxJaiLegal
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort GirlsDeira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort GirlsEscorts Call Girls
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
HLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussHLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussDrMSajidNoor
 
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证wpkuukw
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...Pooja Nehwal
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...amitlee9823
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证tufbav
 

Dernier (20)

Introduction-to-4x4-SRAM-Memory-Block.pptx
Introduction-to-4x4-SRAM-Memory-Block.pptxIntroduction-to-4x4-SRAM-Memory-Block.pptx
Introduction-to-4x4-SRAM-Memory-Block.pptx
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort GirlsDeira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
 
HLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussHLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discuss
 
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
 
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
 
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
 

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)