SlideShare une entreprise Scribd logo
1  sur  48
Unit II - Storage management
 Logical Address is generated by CPU while a program is
running.
 The logical address is virtual address as it does not exist
physically, therefore, it is also known as Virtual Address.
 This address is used as a reference to access the physical
memory location by CPU.
 The term Logical Address Space is used for the set of all
logical addresses generated by a program’s perspective.
 The hardware device called Memory-Management Unit is
used for mapping logical address to its corresponding
physical address.
Differ in execution time
 It identifies a physical location of required data in a
memory.
 The user never directly deals with the physical
address but can access by its corresponding logical
address.
 The program needs physical memory for its
execution, therefore, the logical address must be
mapped to the physical address by MMU before they
are used.
Parameter LOGICAL ADDRESS PHYSICAL ADDRESS
Basic generated by CPU
location in a memory
unit
Visibility
User can view the logical
address of a program.
User can never view
physical address of
program.
Generation generated by the CPU Computed by MMU
Access
The user can use the logical
address to access the physical
address.
The user can indirectly
access physical
address but not
directly.
Editable Logical address can be change.
Physical address will
not change.
Also called virtual address. real address.
 Swapping is a memory management scheme in
which any process can be temporarily
swapped from main memory to secondary
memory so that the main memory can be made
available for other processes.
 It is used to improve main memory utilization.
 In secondary memory, the place where the
swapped-out process is stored is called swap
space.
 It is the type of memory allocation
method. When a process requests the memory,
a single contiguous section of memory blocks
is allotted depending on its requirements.
Fixed-size Partition Scheme
 In this type of contiguous memory allocation
technique, each process is allotted a fixed size
continuous block in the main memory.
 This technique is also called static partitioning.
Variable-size Partition
 In this type of contiguous memory allocation
technique, no fixed blocks or partitions are made in
the memory.
 In Operating Systems, Paging is a storage
mechanism used to retrieve processes from the
secondary storage into the main memory in the form
of pages.
 The main idea behind the paging is to divide each
process in the form of pages. The main memory will
also be divided in the form of frames.
 One page of the process is to be stored in one of the
frames of the memory.
 The partitions of secondary memory are called
as pages.
 The partitions of main memory are called
as frames.
 Address generated by CPU is divided into:
◦ Page number (p) - used as an index into a page table
which contains base address of each page in physical
memory.
◦ Page offset (d) - combined with base address to define
the physical memory address that is sent to the memory
unit. It refers to the number of bits necessary to
represent a certain word on a page, For ex: 10 bits
 Segmentation method works almost similarly
to paging, only difference between the two is
that segments are of variable-length whereas,
in the paging method, pages are always of
fixed size.
Segment table contains mainly two information
about segment:
 Base: It is the base address of the segment
 Limit: It is the length of the segment.
Example of Segmentation in OS
 Consider that a user program has been divided into
five segments and they are numbered from segment 0
to segment 4, as you can see them in the logical
address space.
 You also have a segment table which has entries for
these segment with their base address in physical
memory and their limit.
 Virtual memory is a memory management
technique where secondary memory can be
used as if it were a part of the main memory.

 Demand paging is a memory management
scheme employed by modern operating
systems to manage physical memory
resources.
 Demand paging is a process in which data is moved
from secondary memory to RAM on a demand basis,
which means all data is not stored in the main
memory because the space is limited in RAM.
 Demand Paging is a method in which a page is
only brought into main memory when the CPU
requests it.
 In an operating system that uses paging for memory
management, a page replacement algorithm is
needed to decide which page needs to be replaced
when a new page comes in.
FIFO
LRU
OPTIMAL
Page Replacement Algorithms:
 Page fault/ Miss: If the searching page is not in
memory
 Page Hit: If the searching page that was available in
memory.
 This is the simplest page replacement
algorithm.
 Replaced the pages that has been in memory
for the longest time
Example 1: Consider page reference string
1, 3, 0, 3, 5, 6, 3 with 3 page frames. Find the
number of page faults.
Advantages
 This algorithm is simple and easy to use.
 FIFO does not cause more overhead.
Disadvantages
 This algorithm does not make the use of the frequency
of last used time rather it just replaces the Oldest
Page.
 There is an increase in page faults as page frames
increases.
 The performance of this algorithm is the worst.
 In this algorithm, pages are replaced which would not be
used for the longest duration of time in the future
Advantages of OPR
 This algorithm is easy to use.
 This algorithm provides excellent efficiency and is less
complex.
 For the best result, the implementation of data structures is
very easy
Disadvantages of OPR
 Practical Implementation is not possible because the
operating system is unable to track the future request
Example-2: Consider the page references 7, 0, 1, 2, 0, 3, 0, 4,
2, 3, 0, 3, 2, 3 with 4 page frame. Find number of page fault.
 In this algorithm, page will be replaced which is least
recently(Long back) used.
 The page that has not been used for the longest time
in the main memory will be selected for replacement.
 This algorithm is easy to implement.
 Example-3: Consider the page reference
string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3
with 4 page frames. Find number of page
faults.
Advantages of LRU
 It is an efficient technique.
 With this algorithm, it becomes easy to identify the
faulty pages that are not needed for a long time.
 It helps in Full analysis.
Disadvantages of LRU
 It is expensive and has more complexity.
 There is a need for an additional data structure.
 In this algorithm, page will be replaced which has
been used recently.
 This is the Last in First Out algorithm and works
on LIFO principles.
 In this algorithm, the newest page is replaced by the
requested page.
Example: Let’s see how the LIFO performs for
our example string of 3, 1, 2, 1, 6, 5, 1, 3 with
3-page frames:
Advantages
 Simple implementation:
 Low overhead:
Disadvantages
 Poor performance:
 May result in page thrashing: LIFO page
replacement algorithm can result in a situation known
as page thrashing, where the pages are frequently
swapped in and out of memory, leading to high page
fault rates and poor system performance.
 THANK YOU

Contenu connexe

Similaire à STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptx

Understanding operating systems 5th ed ch03
Understanding operating systems 5th ed ch03Understanding operating systems 5th ed ch03
Understanding operating systems 5th ed ch03
BarrBoy
 
Adobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging documentAdobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging document
AllyKhan2
 
Ch10 OS
Ch10 OSCh10 OS
Ch10 OS
C.U
 

Similaire à STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptx (20)

CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memory
 
Abhaycavirtual memory and the pagehit.pptx
Abhaycavirtual memory and the pagehit.pptxAbhaycavirtual memory and the pagehit.pptx
Abhaycavirtual memory and the pagehit.pptx
 
unit5_os (1).pptx
unit5_os (1).pptxunit5_os (1).pptx
unit5_os (1).pptx
 
CSI-503 - 8.Paging and Segmentation
CSI-503 - 8.Paging and SegmentationCSI-503 - 8.Paging and Segmentation
CSI-503 - 8.Paging and Segmentation
 
Mem mgt
Mem mgtMem mgt
Mem mgt
 
Unit 2chapter 2 memory mgmt complete
Unit 2chapter 2  memory mgmt completeUnit 2chapter 2  memory mgmt complete
Unit 2chapter 2 memory mgmt complete
 
Understanding operating systems 5th ed ch03
Understanding operating systems 5th ed ch03Understanding operating systems 5th ed ch03
Understanding operating systems 5th ed ch03
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Adobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging documentAdobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging document
 
OSCh10
OSCh10OSCh10
OSCh10
 
Ch10 OS
Ch10 OSCh10 OS
Ch10 OS
 
OS_Ch10
OS_Ch10OS_Ch10
OS_Ch10
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
 
Module 4 memory management
Module 4 memory managementModule 4 memory management
Module 4 memory management
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
 
Memory management
Memory managementMemory management
Memory management
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Ie3313971401
Ie3313971401Ie3313971401
Ie3313971401
 
Ie3313971401
Ie3313971401Ie3313971401
Ie3313971401
 
CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management
 

Plus de DivyaKS18 (10)

UNIX.ppt
UNIX.pptUNIX.ppt
UNIX.ppt
 
System calls in OS.pptx
System calls in OS.pptxSystem calls in OS.pptx
System calls in OS.pptx
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptx
 
OS introduction.pptx
OS introduction.pptxOS introduction.pptx
OS introduction.pptx
 
exception -ppt.pptx
exception -ppt.pptxexception -ppt.pptx
exception -ppt.pptx
 
DES
DES DES
DES
 
monte carlo simulation
monte carlo simulationmonte carlo simulation
monte carlo simulation
 
mac-protocols
mac-protocols mac-protocols
mac-protocols
 
SMTP and TCP protocol
SMTP and TCP protocolSMTP and TCP protocol
SMTP and TCP protocol
 
Multithreading -Thread Fundamentals6.pptx
Multithreading -Thread Fundamentals6.pptxMultithreading -Thread Fundamentals6.pptx
Multithreading -Thread Fundamentals6.pptx
 

Dernier

Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Dernier (20)

Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptx

  • 1. Unit II - Storage management
  • 2.  Logical Address is generated by CPU while a program is running.  The logical address is virtual address as it does not exist physically, therefore, it is also known as Virtual Address.  This address is used as a reference to access the physical memory location by CPU.  The term Logical Address Space is used for the set of all logical addresses generated by a program’s perspective.  The hardware device called Memory-Management Unit is used for mapping logical address to its corresponding physical address.
  • 3.
  • 5.  It identifies a physical location of required data in a memory.  The user never directly deals with the physical address but can access by its corresponding logical address.  The program needs physical memory for its execution, therefore, the logical address must be mapped to the physical address by MMU before they are used.
  • 6.
  • 7.
  • 8. Parameter LOGICAL ADDRESS PHYSICAL ADDRESS Basic generated by CPU location in a memory unit Visibility User can view the logical address of a program. User can never view physical address of program. Generation generated by the CPU Computed by MMU Access The user can use the logical address to access the physical address. The user can indirectly access physical address but not directly. Editable Logical address can be change. Physical address will not change. Also called virtual address. real address.
  • 9.  Swapping is a memory management scheme in which any process can be temporarily swapped from main memory to secondary memory so that the main memory can be made available for other processes.  It is used to improve main memory utilization.  In secondary memory, the place where the swapped-out process is stored is called swap space.
  • 10.  It is the type of memory allocation method. When a process requests the memory, a single contiguous section of memory blocks is allotted depending on its requirements.
  • 11. Fixed-size Partition Scheme  In this type of contiguous memory allocation technique, each process is allotted a fixed size continuous block in the main memory.  This technique is also called static partitioning.
  • 12.
  • 13. Variable-size Partition  In this type of contiguous memory allocation technique, no fixed blocks or partitions are made in the memory.
  • 14.
  • 15.  In Operating Systems, Paging is a storage mechanism used to retrieve processes from the secondary storage into the main memory in the form of pages.  The main idea behind the paging is to divide each process in the form of pages. The main memory will also be divided in the form of frames.  One page of the process is to be stored in one of the frames of the memory.
  • 16.  The partitions of secondary memory are called as pages.  The partitions of main memory are called as frames.
  • 17.
  • 18.
  • 19.  Address generated by CPU is divided into: ◦ Page number (p) - used as an index into a page table which contains base address of each page in physical memory. ◦ Page offset (d) - combined with base address to define the physical memory address that is sent to the memory unit. It refers to the number of bits necessary to represent a certain word on a page, For ex: 10 bits
  • 20.
  • 21.  Segmentation method works almost similarly to paging, only difference between the two is that segments are of variable-length whereas, in the paging method, pages are always of fixed size.
  • 22. Segment table contains mainly two information about segment:  Base: It is the base address of the segment  Limit: It is the length of the segment.
  • 23. Example of Segmentation in OS  Consider that a user program has been divided into five segments and they are numbered from segment 0 to segment 4, as you can see them in the logical address space.  You also have a segment table which has entries for these segment with their base address in physical memory and their limit.
  • 24.
  • 25.  Virtual memory is a memory management technique where secondary memory can be used as if it were a part of the main memory. 
  • 26.
  • 27.  Demand paging is a memory management scheme employed by modern operating systems to manage physical memory resources.
  • 28.  Demand paging is a process in which data is moved from secondary memory to RAM on a demand basis, which means all data is not stored in the main memory because the space is limited in RAM.
  • 29.  Demand Paging is a method in which a page is only brought into main memory when the CPU requests it.
  • 30.
  • 31.
  • 32.  In an operating system that uses paging for memory management, a page replacement algorithm is needed to decide which page needs to be replaced when a new page comes in. FIFO LRU OPTIMAL
  • 33. Page Replacement Algorithms:  Page fault/ Miss: If the searching page is not in memory  Page Hit: If the searching page that was available in memory.
  • 34.  This is the simplest page replacement algorithm.  Replaced the pages that has been in memory for the longest time
  • 35. Example 1: Consider page reference string 1, 3, 0, 3, 5, 6, 3 with 3 page frames. Find the number of page faults.
  • 36. Advantages  This algorithm is simple and easy to use.  FIFO does not cause more overhead. Disadvantages  This algorithm does not make the use of the frequency of last used time rather it just replaces the Oldest Page.  There is an increase in page faults as page frames increases.  The performance of this algorithm is the worst.
  • 37.  In this algorithm, pages are replaced which would not be used for the longest duration of time in the future Advantages of OPR  This algorithm is easy to use.  This algorithm provides excellent efficiency and is less complex.  For the best result, the implementation of data structures is very easy Disadvantages of OPR  Practical Implementation is not possible because the operating system is unable to track the future request
  • 38. Example-2: Consider the page references 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3 with 4 page frame. Find number of page fault.
  • 39.  In this algorithm, page will be replaced which is least recently(Long back) used.  The page that has not been used for the longest time in the main memory will be selected for replacement.  This algorithm is easy to implement.
  • 40.  Example-3: Consider the page reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3 with 4 page frames. Find number of page faults.
  • 41. Advantages of LRU  It is an efficient technique.  With this algorithm, it becomes easy to identify the faulty pages that are not needed for a long time.  It helps in Full analysis. Disadvantages of LRU  It is expensive and has more complexity.  There is a need for an additional data structure.
  • 42.  In this algorithm, page will be replaced which has been used recently.  This is the Last in First Out algorithm and works on LIFO principles.  In this algorithm, the newest page is replaced by the requested page.
  • 43. Example: Let’s see how the LIFO performs for our example string of 3, 1, 2, 1, 6, 5, 1, 3 with 3-page frames:
  • 44. Advantages  Simple implementation:  Low overhead: Disadvantages  Poor performance:  May result in page thrashing: LIFO page replacement algorithm can result in a situation known as page thrashing, where the pages are frequently swapped in and out of memory, leading to high page fault rates and poor system performance.
  • 45.
  • 46.
  • 47.