SlideShare a Scribd company logo
1 of 19
Paging
And Segmentation
 Involve swapping block of data from second
memory
 Memory needs to be allocated to ensure a reasonable
supply of ready processes to consume available
processor time
 Memory management requirements:
 Relocation
 Protection
 Sharing
 Logical organisation
 Physical organisation
Memory management
 Paging is a partition memory into small equal fixed-
size chunks and divide each process into the same
size chunks
 Pages-The chunks of a process
 Frame or pages frame-The chunks of a memory
 Page table:
 Contains the frame location for each page in the
process
 Memory address consist of a page number and offset
within the page
PAGING

Process Pages to
free frames
 Some of the frames in memory are use and some are free.
 A list of frames is maintained by the OS.
 Process A stored on disk and it consist of four pages.
 OS will find the four free frames and loads the
four pages of process A into four frames.

…
 Process B consisting of three pages and Process C consisting of four
pages are subsequently loaded.
 Process B is suspended and swapped out to main memory.
 All the process in main memory will blocked
 OS need to bring a new process, which is process D that contain five
pages.

 The five pages of process D are loaded into frames
5,6,11, and 12.

 A pages tables contain one entry for each pages of the process.
 The table easily indexed by the pages number (starting at 0)
 Each pages table entry contains the number of the frame in
main memory that hold the corresponding page.
 A free frame list, available for pages, is maintained
 Thus we will se the simple paging is similar to fixed partioning.

 manages the main memory by dividing the memory into
regions/fixed/variable size is called partitioning
 Two types of partitions
1. Static Partition
Whole memory is divided into fixed sized frame
2. Dynamic Partition
Memory is divided into variable sized frame according to
page size
Partitioning

Partitioning example :
P1
P2
P4
P3
P3
P1
P4
P3
P2
Static
Partition
Dynamic
Partition
0
10
32
25
15
0
42
49
34
20
10
51
66
70 70
28
Proces
s
Space
P1 10
P2 10
P3 14
P4 15
Total space for
those of partition

pAGING
CPU
p d f d
Physical
memory
f
p
Logical
address
Physical
address
Page table
 Visual address of a process divided into
1. page number (p) – index to page table
2. page offset (d) – offset into page/frame

PAGING EXample
0 0 1 0 1 1
10
01
11
00
000
001
010
111
110
101
100
011
000
010
111
110
101
100
011
001
00
01
10
11
Offset
page frame
Physical
memory
Logical
memory
 Page size 4 bytes
 Memory size 32 bytes (8 pages)

Paging hardware
 Address space 2m
 Page offset 2n
 Page number 2m-n
p d
Page
number
Page
offset
m-n n
Note :
Not losing any
space !
Step : address translation
1. Extract the page number as the n nits of the logical address
2. Use the page number as an index into process page table to
find the frame number, k
3. The starting physical address of the frame is k * 2m , the
physical address of the referenced bytes is that number plus
offset.
Physical
memory
2m bytes

Segmentation
Step : Address translation from virtual to physical
address
1. Extract the segment number as the n bits of the
logical address
2. Use the segment number as an index into the
process segment table to find the starting physical
address of the segment
3. Compare the offset, expressed in the m bits, to the
length of the segment. If offset is “>=“ to the
length, the address is invalid.
4. The desired physical address is the sum of the
starting physical address of the segment plus
offset.

Segmentation
CPU s d
< +
limit base
s
Physical memory
Segment
table
yes
Trap, addressing error
Physica
l
address
no
Logical
address
main
stack
Paging
logical address
page number = 1 [000001]
offset = 478 [0111011110]
Physical address
Residing frame = 6 [000110]
offset = 478 [0111011110]
Physical address
= 0001100111011110
Segmentation
logical address
page number = 1 [0001]
offset = 752 [001011110000]
Physical address
Residing frame = 4 [0010000000100000]
offset = 752 [001011110000]
Physical address
= 0010000000100000 + 001011110000
= 0010001100010000

The End..
pROjECT: oPERATing sYSTem
From:
FATIN NABILAH BT ABDUL RAMAN
CHONG LEE MAN
HAFIZOH BINTI MD ISA
SITI FATIHAH BT MOHD SOHAIMI
Lecturer :
DR NURUL AZMA ZAKARIA

More Related Content

What's hot

Batch creation of METS files
Batch creation of METS filesBatch creation of METS files
Batch creation of METS filesKelley Rowan
 
Dynamic multi level indexing Using B-Trees And B+ Trees
Dynamic multi level indexing Using B-Trees And B+ TreesDynamic multi level indexing Using B-Trees And B+ Trees
Dynamic multi level indexing Using B-Trees And B+ TreesPooja Dixit
 
good practices in formatting ms excel spreadsheets
good practices in formatting ms excel spreadsheetsgood practices in formatting ms excel spreadsheets
good practices in formatting ms excel spreadsheetsDescartes Arreza
 
Case Problem: Frame.xlsx
Case Problem: Frame.xlsxCase Problem: Frame.xlsx
Case Problem: Frame.xlsxViscKand
 
File organization 1
File organization 1File organization 1
File organization 1Rupali Rana
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMSkoolkampus
 

What's hot (11)

Batch creation of METS files
Batch creation of METS filesBatch creation of METS files
Batch creation of METS files
 
Dynamic multi level indexing Using B-Trees And B+ Trees
Dynamic multi level indexing Using B-Trees And B+ TreesDynamic multi level indexing Using B-Trees And B+ Trees
Dynamic multi level indexing Using B-Trees And B+ Trees
 
good practices in formatting ms excel spreadsheets
good practices in formatting ms excel spreadsheetsgood practices in formatting ms excel spreadsheets
good practices in formatting ms excel spreadsheets
 
Case Problem: Frame.xlsx
Case Problem: Frame.xlsxCase Problem: Frame.xlsx
Case Problem: Frame.xlsx
 
The strength of a spatial database
The strength of a spatial databaseThe strength of a spatial database
The strength of a spatial database
 
Chap13 scr
Chap13 scrChap13 scr
Chap13 scr
 
File organization 1
File organization 1File organization 1
File organization 1
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
 
Ch10
Ch10Ch10
Ch10
 
Segmentation in operating systems
Segmentation in operating systemsSegmentation in operating systems
Segmentation in operating systems
 
Segmentation
SegmentationSegmentation
Segmentation
 

Similar to Memory management

Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptxSourabhRaj29
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Csc4320 chapter 8 2
Csc4320 chapter 8 2Csc4320 chapter 8 2
Csc4320 chapter 8 2bshikhar13
 
Paging,Segmentation & Segment with Paging
Paging,Segmentation & Segment with PagingPaging,Segmentation & Segment with Paging
Paging,Segmentation & Segment with PagingMeghaj Mallick
 
381 ccs chapter6_updated(2)
381 ccs chapter6_updated(2)381 ccs chapter6_updated(2)
381 ccs chapter6_updated(2)Rabie Masoud
 
Paging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantagePaging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantagesohinibanerjee121
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating SystemRaj Mohan
 
Chapter 04
Chapter 04Chapter 04
Chapter 04 Google
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdfHarika Pudugosula
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptxRohitPaul71
 
Paging and Segmentation
Paging and SegmentationPaging and Segmentation
Paging and SegmentationMadhur Gupta
 

Similar to Memory management (20)

Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptx
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Csc4320 chapter 8 2
Csc4320 chapter 8 2Csc4320 chapter 8 2
Csc4320 chapter 8 2
 
Paging,Segmentation & Segment with Paging
Paging,Segmentation & Segment with PagingPaging,Segmentation & Segment with Paging
Paging,Segmentation & Segment with Paging
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
381 ccs chapter6_updated(2)
381 ccs chapter6_updated(2)381 ccs chapter6_updated(2)
381 ccs chapter6_updated(2)
 
Paging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantagePaging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantage
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Unit 5
Unit 5Unit 5
Unit 5
 
Chapter 04
Chapter 04Chapter 04
Chapter 04
 
Memory management
Memory managementMemory management
Memory management
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdf
 
Memory comp
Memory compMemory comp
Memory comp
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptx
 
Memory+management
Memory+managementMemory+management
Memory+management
 
Os4
Os4Os4
Os4
 
Os4
Os4Os4
Os4
 
Paging and Segmentation
Paging and SegmentationPaging and Segmentation
Paging and Segmentation
 

Recently uploaded

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
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...christianmathematics
 

Recently uploaded (20)

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
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
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
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...
 

Memory management

  • 2.  Involve swapping block of data from second memory  Memory needs to be allocated to ensure a reasonable supply of ready processes to consume available processor time  Memory management requirements:  Relocation  Protection  Sharing  Logical organisation  Physical organisation Memory management
  • 3.  Paging is a partition memory into small equal fixed- size chunks and divide each process into the same size chunks  Pages-The chunks of a process  Frame or pages frame-The chunks of a memory  Page table:  Contains the frame location for each page in the process  Memory address consist of a page number and offset within the page PAGING
  • 4.  Process Pages to free frames  Some of the frames in memory are use and some are free.  A list of frames is maintained by the OS.  Process A stored on disk and it consist of four pages.  OS will find the four free frames and loads the four pages of process A into four frames.
  • 5.  …  Process B consisting of three pages and Process C consisting of four pages are subsequently loaded.  Process B is suspended and swapped out to main memory.  All the process in main memory will blocked  OS need to bring a new process, which is process D that contain five pages.
  • 6.   The five pages of process D are loaded into frames 5,6,11, and 12.
  • 7.   A pages tables contain one entry for each pages of the process.  The table easily indexed by the pages number (starting at 0)  Each pages table entry contains the number of the frame in main memory that hold the corresponding page.  A free frame list, available for pages, is maintained  Thus we will se the simple paging is similar to fixed partioning.
  • 8.   manages the main memory by dividing the memory into regions/fixed/variable size is called partitioning  Two types of partitions 1. Static Partition Whole memory is divided into fixed sized frame 2. Dynamic Partition Memory is divided into variable sized frame according to page size Partitioning
  • 10.  pAGING CPU p d f d Physical memory f p Logical address Physical address Page table  Visual address of a process divided into 1. page number (p) – index to page table 2. page offset (d) – offset into page/frame
  • 11.  PAGING EXample 0 0 1 0 1 1 10 01 11 00 000 001 010 111 110 101 100 011 000 010 111 110 101 100 011 001 00 01 10 11 Offset page frame Physical memory Logical memory  Page size 4 bytes  Memory size 32 bytes (8 pages)
  • 12.  Paging hardware  Address space 2m  Page offset 2n  Page number 2m-n p d Page number Page offset m-n n Note : Not losing any space ! Step : address translation 1. Extract the page number as the n nits of the logical address 2. Use the page number as an index into process page table to find the frame number, k 3. The starting physical address of the frame is k * 2m , the physical address of the referenced bytes is that number plus offset. Physical memory 2m bytes
  • 13.  Segmentation Step : Address translation from virtual to physical address 1. Extract the segment number as the n bits of the logical address 2. Use the segment number as an index into the process segment table to find the starting physical address of the segment 3. Compare the offset, expressed in the m bits, to the length of the segment. If offset is “>=“ to the length, the address is invalid. 4. The desired physical address is the sum of the starting physical address of the segment plus offset.
  • 14.  Segmentation CPU s d < + limit base s Physical memory Segment table yes Trap, addressing error Physica l address no Logical address main stack
  • 15.
  • 16. Paging logical address page number = 1 [000001] offset = 478 [0111011110] Physical address Residing frame = 6 [000110] offset = 478 [0111011110] Physical address = 0001100111011110
  • 17.
  • 18. Segmentation logical address page number = 1 [0001] offset = 752 [001011110000] Physical address Residing frame = 4 [0010000000100000] offset = 752 [001011110000] Physical address = 0010000000100000 + 001011110000 = 0010001100010000
  • 19.  The End.. pROjECT: oPERATing sYSTem From: FATIN NABILAH BT ABDUL RAMAN CHONG LEE MAN HAFIZOH BINTI MD ISA SITI FATIHAH BT MOHD SOHAIMI Lecturer : DR NURUL AZMA ZAKARIA